Do you want to hide or remove a specific category from displaying in the post meta area of a WordPress theme? By default, we can either remove or hide all categories or display all categories assigned to a specific post. Since, each category does not have unique CSS class, we can not use display:none; function to target a specific category.

PHP code to remove Categories from post meta

Just add following code to functions.php file of your theme. It should work on any WordPress theme (it was tested successfully on Genesis Sample Theme).

https://gist.github.com/21635713a04dbaf3414d

The above code removes: “Featured” and “Category #1” from the post meta area. (Code Credits)

Before & After in Genesis Sample theme

Remove categories in post meta in genesis wordpress theme

If you use categories for personal organization of posts in the back-end, you can easily hide those categories assigned to posts in the front end using code shared above.

4 Comments

  1. John on January 20, 2017 at 11:01 pm

    Perfect, This is just what I was looking for. Thanks for sharing

  2. Edu on May 14, 2017 at 8:12 am

    Hi! First of all let me send you my gratitude for showing me how to get rid of the “Uncategorized” title! Can you please show me how to get rid as well of the “/” in “Uncategorized / May 12, 2017”?

    Thanks!!

    • S on February 18, 2018 at 11:12 pm

      1.In your editor find content-single.php (under the template-parts).
      2. You should find something similar to this:
      <!–\ –>
      3. Delete the \
      4. Update File

  3. H. M. Stuart on February 28, 2018 at 3:00 am

    For some reason this code, which has been and continues to work flawlessly in the Misty Lake theme does not seem to work when transplanted to the Graphy theme.

    Any help appreciated.

Leave a Comment