How to remove category base from permalinks
tagged category base, How to remove category base from permalinks, permalinks and Wordpress
Looking through the wordpress forums I saw a large number of people wanting to know how to remove ‘category base’ from permalinks. For example http://bloggerholic.com/category/wordpress/
I found the solution and it’s easy! This is only for Wordpress 2.0+
All you need to do is the following:
- Go to your wp-includes folder.
- find the template file called “category-template.php” and open the file in any text editor.
- Find the follwing line $catlink = $wp_rewrite->get_category_permastruct();
You will see this code two lines below function get_category_link($category_id) { - Below it add the following line $catlink = str_replace(’/category’, ”, $catlink);
NOTE:
Due to the font the code has changed, Please make a note to change the curly quotes into standard text quotes. - Save the file and upload “category-template.php” in wp_includes folder.
Update: For those using wordpress version 2.61 and 2.62 the above will not work so you will need to do the following:
- Go to your wp-includes folder.
- find the template file called “category-template.php” and open the file in any text editor.
- In this file find the following function, function get_category_link($category_id) {
- Find the following line inside this function $catlink = get_option(’home’) . user_trailingslashit($catlink, ‘category’);
- Below it add the following line $catlink = str_replace(’/category’, ”, $catlink);
- Save the file and upload “category-template.php” in wp_includes folder.
That’s it your done!
NOTE: Make sure you don’t name your page name the same as category name.
Go back to:Wordpress for Dummies
This book “Wordpress for Dummies” provides you with everything you need to get up and running with WordPress. The book covers blogging basics, choosing a hosting solution or setting up a host, developing blog content, syndicating blog posts with RSS, launching a specialized blog (including podcasting, photoblogging, mobile blogging, and videoblogging), and even earning revenue.
It Includes help on every aspect of installing and using WordPress, illustrations from real-world WordPress blogs, step-by-step tutorials on key topics, and insights from bloggers who have used WordPress

