Exclude Specific Categories From Native WordPress Category Widget

Add one or both of these code snippets to the end of your child themes functions.php file to exclude one of more post categories from displaying in the native WordPress categories widget list and/or drop down menu.

Related Solutions


Comments

4 responses to “Exclude Specific Categories From Native WordPress Category Widget”

  1. Brad Dalton Avatar
    Brad Dalton

    There’s 2 filters included in the native WordPress Categories widget:

    1 for the list
    and one for the drop down

    See updated post.

    1. Gretchen Louise Avatar
      Gretchen Louise

      Thank you so much for updating your post! That worked. Your help is much appreciated.

      1. Brad Dalton Avatar
        Brad Dalton

        No worries.

        Looks like you’re using both at the same time.

  2. Gretchen Louise Avatar
    Gretchen Louise

    This code works for the category widget, but choosing “display as drop-down” makes the code stop working. With category widgets side by side, the regular category widget does not display the excluded category, the drop-down widget does display the excluded category. Any idea on how to get this code to apply to the drop-down category widget as well? Thank you!

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.