Remove 'Category Base' From Permalinks
The biggest frustration I've had with WordPress is the inability to remove the 'Category Base' from the url permalink structure. I am not alone. This issue has been raised many times on the Support forums.
Adding this option would really help increase WordPress's acceptance as a viable CMS alternative. As it stands now, if one mixes categories with pages, one comes up with a really illogical url scheme:
To make matters worse, going to http://www.site.com/category/ will result in "Page Not Found". 'Category' is supposed to represent a directory in a website's directory structure!
It seems to me that there is a simple solution. Allow the user to turn off Pages. Without pages, there should be no need for the Category Base prefix. Those that like Pages can continue to use them, those that don't can ditch them.
Completely agree with you nateomedia. As we have started the structuring of our site, we are learning the "hard way" about the limitations of the "category" challenges in WP. We've tried to take advantage of the category base to make for better looking URI's, however, the fact remains that they are still in the "category" slot of the permalink.
Seriously considering just doing away with categoric taxonomy and relying solely on tagging for content structure and navigation.
I think it's interesting that Matt's own WordPress Blog relies on a tagging system for categories. Lorelle's Blog wedges in a site map as the category base.
I think the fact that some of the bigger names in the WordPress community have had to shy away from using a strictly category based structure shows that something is not quite right here.
Well, we gotta be careful there, NateO. Both of those scenarios could very easily be them just using the category base settings in the permalink controls. And I could totally understand them being used simply for the potential indexing power that both "tag" and "site-map" could have in the search engine.
Guess that's the beauty of a php (asp, cmf, whatever) platform/application. You never really know what's behind the curtain (or door number two for that matter. They never picked door number two..:)
I'll third it... if one wants to have a category base, the category structure template allows it, there is no need for another field. Or, at least, please, please remove the default value!
So I cannot have my blog list posts from a category in a URL like http://myblogdomain.com/category-name/ ?
I have to use http://myblogdomain.com/category/category-name/ ?
charbax, your posts can look like this:
but when you want to view all posts under category-name, you have to use this:
where category is a changeable name.
the issue here is that it IS inconsistent. i'd rather have posts written as /category-name/post-name/ and therefore moving "one directory higher" we view all posts under category-name, removing the need for "category" in the url. sigh.
It is possible to remove the category base from the permalink. Well, not on the administration panel, but with a small hack:
On line 371 of the wp-includes/rewrite.php file, you'll see the code:
$this->category_structure = $this->front . 'category/';
Now just remove the "category" from the string, and the code should look like:
$this->category_structure = $this->front . '/';
It looks like it actually is possible to accomplish this through the admin panel with a solution pointed out here by petervcook.
Just enter /. as the value for Category base.
Seemed to work perfectly when I tested it. I'd be interested in hearing if anyone discovers other dangers to doing this, other than the obvious potential of collisions between posts, pages, and categories.
A while back, I coded a plugin to workaround this limitation for my site. I had tried Clintonium's suggestion, but ran into some problems that I honestly can't remember (been a couple of years).
The plugin is available here: Top Level Categories.
Hopefully it makes it into the next version!
RSS feed for this topic
This topic has been closed to new replies.