How to remove category base from permalinks

tagged , , and

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:

  1. Go to your wp-includes folder.
  2. find the template file called “category-template.php” and open the file in any text editor.
  3. Find the follwing line $catlink = $wp_rewrite->get_category_permastruct();
    You will see this code two lines below function get_category_link($category_id) {
  4. 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.
  5. 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:

  1. Go to your wp-includes folder.
  2. find the template file called “category-template.php” and open the file in any text editor.
  3. In this file find the following function, function get_category_link($category_id) {
  4. Find the following line inside this function  $catlink = get_option(’home’) . user_trailingslashit($catlink, ‘category’);
  5. Below it add the following line $catlink = str_replace(’/category’, ”, $catlink);
  6. 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

27 Comments »



Resources

Categories

FREE Newsletter

Sign up TODAY and get FREE Tips every Week on Making Money on the Internet 

(required)
(required)
 

Recommended Book


      

Tag Cloud

Wordpress Blog Marketing Blogging Tips Blogging Tools and Services Advertising VoIP Blogging for Money Search Engine Optimization Adsense General

Recommended Money Makers


      Text Link Ads
      Blog Mastermind Affiliates
      AuctionAds
      Amazon Associates

Related Articles

Recent Articles