WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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

share|improve this answer
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 Dec 13 '11 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  );
share|improve this answer
This is not the proper way to do it. You shouldn't be making changes to your core files. – Joshua Abenazer Dec 12 '11 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 Dec 12 '11 at 10:58
Agreed. There are plenty of filters for manipulating rewrites. – chrisguitarguy Dec 12 '11 at 14:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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