• Skip to primary navigation
  • Skip to main content

Jerad Hill

Blog of Life & Business Persuits

  • About
  • Topics
    • Blog
    • Business
    • Tutorials
    • Family
    • Family Adventures
    • Health & Fitness
    • Income Reports
    • Marriage
    • Newsletter
    • Parenting
    • Passive Income
    • Personal Development
    • Photography
    • Projects
    • Reviews
    • Technology
    • Tutorials
      • Notion
  • Podcast
  • Newsletter
  • My Sites
    • Learn With Jerad
    • State of Tech
    • Gear & Light
    • Hill Media Group
    • Jerad Hill Photographer

Exclude a Category from your WordPress Menu

April 15, 2009

On occasion you may want a blog category not to show up in your blog menu. Many themes now a days are including settings you can change to remove categories from menus but if you end up having to hard code it in here is what you need to do.

Open up the header.php file located inside the folder for your wordpress theme. You will need to replace the #3 in the code below with the id number of the category you wish to not include in your menu. If you categorize your entry in more then one category your category will still show up in the blog listing if your theme shows which category each entry is in. If you want to exclude more then one category simply add a comma after the first category number and enter the next category number with no spaces.

wp-remove-category-menu

This will not remove the category from the frontpage. To remove the category from the frontpage check out my blog on Excluding a Category from your WordPress Frontpage.

Filed Under: Blog Tagged With: wordpress 6 Comments

Reader Interactions

Comments

  1. Bill Bartmann says

    September 2, 2009 at 3:44 am

    Cool site, love the info.

  2. GeneTinsley says

    October 9, 2009 at 3:59 pm

    Super-Duper site! I am loving it!! Will come back again – taking your feeds too now, Thanks.

  3. InjesteNits says

    January 3, 2010 at 3:34 pm

    I am frequently searching for brandnew articles in the world wide web about this topic. Thanx!

  4. Webagent says

    April 21, 2010 at 11:00 am

    Thank you, I bookmark your site 😉

  5. azura says

    November 5, 2010 at 5:39 am

    Hello thanks for the code, but I want to exclude by name, not by id. Is this possible????? How???? Thanks in advance for any help

  6. Fest says

    November 9, 2010 at 11:44 am

    I tried to do this but with no result.

    The only place I found the line though was in the sidebar.php and not in the header, perhaps that was the problem.

    The re is a plugin to do this, something with exclude category, but it also removes the category from my frontpage, so that didn’t work either.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © 2021 · Jerad Hill