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.
Exclude Specific Categories From Native WordPress Category Widget
—
by
4 responses to “Exclude Specific Categories From Native WordPress Category Widget”
There’s 2 filters included in the native WordPress Categories widget:
1 for the list
and one for the drop downSee 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!
Free
$0
Access only to all free tutorials per month.
Tutorial Request
Includes code guarantee and coding support.
Monthly
$75
Access to 10 premium tutorials per month.
Tutorial Request
Includes code guarantee and coding support.
Yearly
$500
Access to 15 premium tutorials per month.
Monthly Tutorial Request
Includes code guarantee and priority coding support.
Was This Tutorial Helpful?