When you’re building a website in WordPress and using it as a CMS, you’re going to have pages that you don’t want showing in your main site navigation/menu.
How do you keep those pages from showing up in your navigation?
Include and Exclude Specific Pages
There are several methods, but most of them require hard coding the menu to either exclude specific pages from the navigation…
Or including only certain pages like so:
<?php wp_list_pages('include=1,2,3,6,19' ); ?>
These methods work, but are impractical (at least for client work) because they’re not flexible enough.
What happens when you add more pages to the site, or want to add/remove pages in the nav?
Also, could you explain how to make the needed code edits to your clients? I don’t think so.
Use a Plugin
The fastest, most flexible and easiest to use method is to just use a plugin.
My choice is the Exclude Pages plugin from Simon Wheatley.
After you activate it, Exclude Pages gives you a new option on the write panel for each page—’Include this page in user menus‘.
The option is checked by default on all the new pages you create, so if you don’t want the page to show up in the navigation, simply uncheck the box before publishing, and it never shows.
It also removes pages that have already been published.
The Exclude Pages plugin is great because clients (and you) can easily choose which pages to include in the site’s navigation. Unticking a box is a whole lot easier to explain than editing code.
Use Bookmarks For Your Navigation
Another option is to use WordPress’ built-in links to create site navigation.
Justin Tadlock offers an interesting take on using links (blogroll/bookmarks) to create navigation.
This is a pretty creative approach, and it makes logical use of your blogroll.
The only downside I see is that, you’ll have to rework your theme to incorporation this technique—it’s not a quick, drop-in solution.
Do you have any other suggestions for removing pages from your WordPress navigation? Share with us in the comments.