Tame Those Unruly Sidebar Categories

June 25th, 2008

Take a look at your blog (or website) categories. What do you see? A handful of easy to understand and navigate categories or a tangled mess?

I’ve had this blog for a long time. 4 years to be exact and it has grown up with the blogging ‘industry’. Back then, I created a few categories and over the years this just grew and grew. So now, I am forced to ‘tame’ them. But the problem is, with so many posts, I didn’t want to wait until I have time to re-organize each post. So how do I quickly keep unwanted categories from displaying, so I can deal with them on my own time?

If you’re running WordPress, you’re so in luck because they made is super easy.

Step 1 

Log in as administrator, go to you Manage >> Categories to pull up a list of all your categories. Hover your mouse over the categories you want to remove. In your browser status bar (the area at the bottom left of your browser). Look for cat_ID=XX

Get WordPress Category ID

Write down the number. Do this for each category you want to remove.

Step 2 

In your theme sidebar.php file, look for a line that looks like this code:

1
<?php wp_list_categories('arguments'); ?>

Change it to this. It tells WordPress to hide the specified category IDs

1
<?php wp_list_categories('exclude=10'); ?>

If you have more than one category, simply type in the category ID numbers you collected in Step 1, separate them with a comma like this

1
<?php wp_list_categories('exclude=1,11,13'); ?>

If you have more categories you want to hide than you want to keep, you can also do this in reverse by telling WordPress to only display the following category IDs like this:

1
<?php wp_list_categories('include=2,12,14'); ?>
Like this post? Think it'll help someone else? Want to save it? Click here => to Digg, Stumble or bookmark it.

Related Entries

6 Comments to “Tame Those Unruly Sidebar Categories”

  1. Carrie Lauth Says:

    You.Read.My.Mind.

    Was just searching for this info!

  2. Stefanie Says:

    Very cool - I hadn’t really thought of doing this, but I help my mom with her blog and she could DEFINITELY use some pruning.

  3. Lynette Says:

    @Carrie: Totally. But don’t worry, I won’t tell others what else is on your mind ;)

    @Stefanie: Uhuh. I have been dragging my feet on this as well. But my category pains go a little deeper as I need to re-think some of them that’s why I display tags now which I think is becoming another tangled mess.

  4. Kim Says:

    Great tip, Lynette! I’m going to try this.

    But when I eventually do find time to reorganize/delete some of my categories, will it affect anything with Google… page rank, etc?

  5. Lynette Says:

    Hey Kim, while SEO is out of my scope of expertise, I do know that if you change the category names, and you used SE friendly permalinks, changing categories could break some of your site links - e.g. Category pages. Anytime you change your URLs it is likely to affect your standing. To what extent, I don’t know. The only good way about that is to redirect.

    Re-arranging them should not be a problem I would think but again it all depends on how you set up the permalinks. If you have the category in the URLs that could be a problem.

  6. Kim Says:

    Thanks, Lynette. No, I don’t have the categories in the permalinks. So the links wouldn’t be affected.

Leave a Comment