Remove "Category" from Wordpress
Ranked #4,054 in Internet, #221,806 overall
Remove "Category" from Wordpress
The "Category" Curse
This is what we're looking to eliminate!
www.mysite.com/imports/honda »
www.mysite.com/cars/imports »
www.mysite.com/category/cars »
www.mysite.com
The fundamental flaw here is the third path, which introduces the word "category" into the URL against your will. While Wordpress does allow you to change what it is named, it has no option to remove it altogether.
Why Does /category Exist?
The main reason why the developers of Wordpress included the word "category" within their software is because of Wordpress Pages. Pages have a top-level URL structure, like "mysite.com/cars". Because of that fact, there is no way for it to co-exist with a category that is also named "/cars" without there being an additional divider before it, hence, "../category/cars". Currently, there is still no way to simply un-check or deactivate either Pages or Categories in Wordpress.
How to Remove "/category" from Wordpress URLs
The simple, stupid solution
In your Wordpress admin section, visit Settings » Permalinks. Look for the section at the bottom entitled "Optional" that says:
If you like, you may enter custom structures for your category and tag URLs here. For example, using topics as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.
Below it is an input box for "Category base." Simply input a slash and a dot: " /. " That's it - you've effectively killed /category forever, banishing it to hell, where it belongs. Now, your site will continue to work without glitches. However, your Wordpress pages (i.e., mysite.com/cars) will be seen where category pages used to be. In other words, you'll no longer see that worthless category page that lists all Wordpress Posts within it. Instead, it will point directly to the Page of its same name.
Wordpress Category Removal is as Easy as /.
Finally, you can run a real website, especially an eCommerce site that won't force you to display annoying Wordpress Category pages!
What's the Catch?
Does anything bad happen with this hack?
mysite.com/cars/honda/sedans
...and you remove "sedans" and look at "mysite.com/cars/honda", you'll get a 404 error. However, if you go back into your admin section and delete the "/." from your Category Base and re-check that page, it works fine.
Unfortunately, this is an issue baked in to Wordpress' core. It will never truly work properly until the Wordpress developers wake up to the realization of this huge issue in navigation and SEO.
Visitor Feedback
I really hope this tutorial helped you end your Wordpress category frustrations. Feel the need to send some feedback? Do it here!
-
-
corporatexpress
Jul 6, 2011 @ 11:53 am | delete
- you saved my life :), thanks mate.. i removed "category" from all of my blog
-
-
-
Pixelrage
Jul 13, 2011 @ 10:17 am | delete
- Glad to hear it :) this is by far my favorite Wordpress trick. Just this simple edit really opens up the possibilities for your site
-
-
-
Peeyush Gupta
Mar 23, 2011 @ 4:21 am | delete
- /. replaced to only . when i save the page.
-
-
-
Pixelrage
Apr 3, 2011 @ 7:49 pm | delete
- Peeyush, you're correct - it becomes a "." when you re-visit the page. If you ever have to re-save the page, be sure to include the slash so that it is a "/." before you hit "save".
-
-
-
Fredag
Mar 3, 2011 @ 4:30 am | delete
- Nice post on this issue!
But what happens if I want to get the RSS-feed on a specific category? I have not found a solution to this. mysite.com/?cat=11&feed=rss2 doesn´t seem to work with the "slash dot" hack.
-
by Pixelrage
Hi, I'm Mark, and I go by the screenname "Pixelrage" - thanks so much for checking out my work here on Squidoo! If you need to get in touch with me,... more »
- 210 featured lenses
- Winner of 18 trophies!
- Top lens » The Best HDTVs for 2012