Remove category from base link on WP
If you’re planning on using your categories pages in your blog for something and you don’t just cut them off from being indexed from robots, you might need this tip.
You know that the category pages look something like this:
www.yoursite.com/category/category-name/
The problem is that /category/ middle element that disappears in the posts links structure and can have a bad influence on juice spreading inside your site. That’s why it should be great if you could just remove that element, right?
For this you have to get inside the code. But it’s easy. Just open the wp-includes/rewrite.php file.
On line 391 (Wp 2.3.2), you’ll find this code:
if (empty($this->category_base))
$this->category_structure = $this->front . category/‘‘;
All you have to do is cut the bolded category/ string, so your code will end up looking like this:
if (empty($this->category_base))
$this->category_structure = $this->front . ”;
That’s it. Now upload the file on your server and you’re done.
Your category links now look as they suposed too: www.yoursite.com/category-name/ and that gap in the logical structure has been eliminated
Simple huh?
it not work with 2.6.2