Remove "Category" from Wordpress

Ranked #4,054 in Internet, #221,806 overall

Remove "Category" from Wordpress

Wordpress has one fatal flaw as a CMS: the "/category" inclusion of its URLs. Well, guess what - you can remove them with just two keystrokes. Here, we'll review how to make Wordpress display proper URLs without that annoying category cluttering it up!

Bookmark and Share

The "Category" Curse

This is what we're looking to eliminate!

The worst thing about self-hosted Wordpress is that its URLs are unconventional. Even if you modify their permalink structure, you can't escape one major issue: the /category part of a URL. For instance, here's an example of a typical deep URL of a Wordpress site as we move backward from it toward the home page. Look for the "/category"

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

Upon doing a lot of research on the topic, I've come across Wordpress plugins that removed /category with disastrous effects. It seemed as though everyone hated this aspect of Wordpress. It seemed impossible to get Wordpress to behave like a real CMS because of that stupid word. Well, there is a miracle cure, and it works like a charm.

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 "Slash Dot"

Wordpress Category Removal is as Easy as /. 

This is absolutely GREAT for anyone using a breadcrumb trail (such as: Home > Cars > Honda), because the first level link in those situations (which would be "Cars" in this example) will now point to a Wordpress Page called "mysite.com/cars" instead of a list of Posts from the /cars category.

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?

I've used this little "slash-dot" trick with great results. It simply works, and that's all there is to it. However, there is a catch...and it lies in 3rd level (and up) categories. So, if you have the page:

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 »

Feeling creative? Create a Lens!