1

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

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

1
  • 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
-5

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

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

to

$this->category_structure = trailingslashit( $this->front  );
3
  • 2
    This is not the proper way to do it. You shouldn't be making changes to your core files. 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. Dec 12 '11 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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