How to not include a page in main wordpress menu post image

How to not include a page in main wordpress menu

Posted on:

This has been annoying me for ages as im not used to WordPress and not being able to specify what menu a page shows in and where.

So if you want a page to not show in your main menu but as a footer link or something you can use this code.

  1. Make your page and preview it to get the page id number, then publish it for now.
  2. Go to your editor and find the php file with the navigation code, usually header.php
  3. Find this bit of code or something similar – li=&exclude=x'
  4. Where I’ve put the x is where you put the page id that you don’t want to show in your main WordPress menu.
  5. If you have a few pages that you don’t want in the main menu you can do this – li=&exclude=34,96,100' where 34, 96 and 100 are the page id’s.

Perfect for Terms & Conditions, Privacy Statements and Help links in site footers.