The WordPress category widget allows you to list your blog's categories in the sidebar and sometimes the footer, depending on your theme's footer settings.This can be really useful for helping people to navigate your website. The biggest problem however is that many themes use a particular category, for eg a "portfolio" or a "slider" category for managing the posts to use as images in the slider or portfolio.Depending on your website, you possibly don't want people to end up on a page of images used in your slider. So you'd like to hide this category name from the listing of categories that are displayed in the sidebar widget.How do you do this?The default widget doesn't have an option for this, so a quick and easy way is to add a quick function to your childtheme's functions.php file and "exclude" the categories that you'd like to hide.Add the following code into your functions.php file:/* Remove category from category widget */

function dtwd_exclude_widget_category($args){

$exclude = "1,2,3"; // IDs of excluding categories

$args["exclude"] = $exclude;

return $args;



Be sure to replace the 1,2,3 with the actual categories that you'd like to exclude from the category list in the sidebar.


[dtwd-related-posts-sc title="More WordPress tips and ideas" count=5]