You may often get confused why the entire category list of your WordPress blog does not appear on blog sidebar. When you double check your widget section and see that you have properly added “Categories” widget with correct settings, you may get a bit worried thinking something is wrong with your blog!

Well do not panic, WordPress hide empty categories by default. It does not show the categories with zero post. But sometimes you may need to show all the categories even you have no post in them to give the readers an idea of the range of categories exists on the blog where those empty categories will be filled with potential posts in future. To accomplish this, you need to add the following piece of code into your current active theme’s function.php file.

add_filter( 'widget_categories_args', 'wpb_force_empty_cats' );
function wpb_force_empty_cats($cat_args) {
$cat_args['hide_empty'] = 0;
return $cat_args;

You may do this in many different ways. One of the easiest process is to make the changes through your WordPress dashboard. Simply follow the steps below:

  • Go to Appearance > Editor
  • Click on “Theme Functions (functions.php)” file on the right side.
  • Put the piece of code from above and click on “update file” button.

And you are done! Now check the list of categories on your blog sidebar. You should now see full list of categories including empty ones.

This Post Has 4 Comments

    I’m not sure where you’re getting your info, but great topic.
    I needs to spend some time learning more or understanding more.
    Thanks for great information I was looking for this info for my mission.

  2. foot pain doctor

    Hello i am kavin, its my first occasion to commenting anywhere, when i read
    this piece of writing i thought i could also make comment due to this brilliant article.

  3. Hello There. I found your blog using msn. This is a really well written article.
    I will make sure to bookmark it and return to read more of your useful info.
    Thanks for the post. I will definitely comeback.

  4. chocolate

    I am genuinely thankful to the owner of this web site who has
    shared this fantastic paragraph at at this time.

Leave a comment