Written by Claus Heinrich at. 18:12:06, 21:12
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:
with the change it will become:
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;
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:
$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/)
Im having no problems with it.
So feel free to test this out, and any reports back are appreciated.
UPDATED INFO - IMPORTANT: I noticed in my logs that this post is still getting traffic from people looking to change the category/ prefix.
I recommend a good plugin to handle this now: Top Level Categories.