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.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
There’s 2 filters included in the native WordPress Categories widget:
1 for the list
and one for the drop down
See updated post.
Thank you so much for updating your post! That worked. Your help is much appreciated.
No worries.
Looks like you’re using both at the same time.
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!