I want to remove /category/ base from the permalinks. I tried the solution http://wordpress.stackexchange.com/questions/6106/remove-parent-category-from-permalink-basically-only-have-the-child-category/ but if i try pasting this in functions.php, i get the 404 error. I also tried RewriteRule ^category/(.+)$ /$1 [R=301,L] by pasting in .htaccess , but still, i get 404 error.

2 Answers 2


To make things easier why don't you use this plugin -> WP No Category Base

  • As per your recommendations, i haven't modified the code and installed plugin. After installing plugin, if i make any change in wp-admin, all my posts give 404 error.
    – user930026
    Commented Dec 13, 2011 at 17:43

To remove category base from url, go to wp-includes -> rewrite.php line 1031 change

$this->category_structure = trailingslashit( $this->front . 'category' );


$this->category_structure = trailingslashit( $this->front  );
  • 2
    This is not the proper way to do it. You shouldn't be making changes to your core files. Commented Dec 12, 2011 at 10:57
  • DO NOT make what Shefali Aggarwal told you. You shouldn't change anything in the WordPress core. Any changes that you make there will vanish on the next upgrade, if first you don't break anything there. It's a really bad practice to do any changes on the core. Stay away from there.
    – Daniel
    Commented Dec 12, 2011 at 10:58
  • Agreed. There are plenty of filters for manipulating rewrites. Commented Dec 12, 2011 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.