Change or remove the “Category” from your permalinks on a wordpress blog
Posted by Claus Heinrich at December 18th, 2006
My friend Frank over at YouShouldKnow.com just gave me a good tip on how to remove the optional “Category” in your category URL’s on a Wordpress blog.
Normally the categories would look like this:
http://www.clausheinrich.com/category/web-directory/
with the change it will become:
http://www.clausheinrich.com/web-directory/
Find the file wp-includes/classes.php and about halfway down you can change the settings.
To remove the category like above do this:
$this->category_structure = $this->front . ‘category/’;
change it into this:
$this->category_structure = $this->front;
Update:
In the Wordpress 2.1 branch you will find the code in wp-includes/rewrite.php
Thanks to Caio Proiete for informing
Wordpress Version 2.3.x branch:
Delete this:
$this->category_structure = $this->front . ‘category/’; else
Wordpress Version 2.5.x branch:
I have not tried this personally, but reading from comments it is should be possible to now use the Base Category feature to disable the “category” directory.
Brad mentions in comment #27:
Adding the /. in Settings - Permalinks -Category Base field works fine in 2.5.
Where are ppl seeing the /. in the URL? (e.g. www .example.com/./foo/)
I’m having no problems with it.
So feel free to test this out, and any reports back are appreciated.
Technorati Tags: wordpress, blog, category, permalinks, hack




After about 15 hours of work I have my new Paid Directory ready for launch.
I just found this
I stumpled upon this great tool from SEOmoz to measure your