• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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.

Register for full access

Related Solutions

  • Display A List of Posts In Specific Category In Any Theme
  • Adding a List of Posts From Any Category Into a Page, Post or Widget Area

Reader Interactions

Comments

  1. Brad Dalton says

    August 21, 2014 at 4:34 am

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

    1 for the list
    and one for the drop down

    See updated post.

    Log in to Reply
    • Gretchen Louise says

      August 22, 2014 at 6:45 pm

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

      Log in to Reply
      • Brad Dalton says

        August 22, 2014 at 6:51 pm

        No worries.

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

        Log in to Reply
  2. Gretchen Louise says

    August 20, 2014 at 10:16 pm

    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!

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems