Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers 2

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' );

to

$this->category_structure = trailingslashit( $this->front  );
share|improve this answer
2  
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

 
discard

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.