How to Hide WordPress Categories

How to Hide WordPress Categories In the following simple solution, I am going to show you How to keep a selection of WordPress Categories from displaying in your sidebar on your WordPress pages and posts. This is very useful if you have a lot of categories, or have changed the content of your blog, have been indexed for the content and no longer wish to use or display specific categories on your WordPress site. Upon completion of this tutorial, the permalink structure of the hidden categories are still made available to the search engines, however, the categories you have chosen to hide are no longer displayed on your blog to the visitor.

Hiding WordPress Categories

Works up till WordPress 2.6. For later versions, I have created another tutorial to exclude categories from the sidebar in WordPress.

    1. Locate which categories you would like to hide from displaying in the sidebar. Category ID's can be found from the WordPress Admin Panel under Manage-> Categories. In WordPress 2.5 and beyond, simply hover over a category and the cat_ID=# will be listed at the bottom of your browser window.cat_ID=#
    2. Using an FTP client, FTP to your WordPress installation
    3. Navigate to wp-includes/widgets.php and copy widgets.php to your desktop
    4. Open widgets.php with a text editor and find the following line:

$cat_args = "orderby=name&show_count={$c}&hierarchical={$h}";

    1. Change this line by adding &exclude=1,2,3 as shown below:

$cat_args = "orderby=name&show_count={$c}&hierarchical={$h}&exclude=1,2,3";

  1. Change 1,2,3 to correspond to the category ID's that you would like to exclude
  2. Save the widgets.php file and upload it to your wp-includes directory on your server
  3. Go view your site. If all goes well, you should now be displaying all but the excluded categories.