
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.

You should

18 Comments to 'Removing Pages From Navigation in WordPress'
August 3rd, 2009
Hi – Thanks for the link. I agree that many users a plugin is a more practical solution. But there are those of use who don’t want to rely on too many plugins. For my own site, I would do it manually. For a client, it would depend on their needs.
August 3rd, 2009
No problem.
I’ve used the hard-coding method on many of my WP sites, too. It works, but I dread editing theme files just to adjust the nav.
I try not to depend on too many plugins too, but sometimes my inner sloth wins out ;)
August 3rd, 2009
I haven’t tested this extensively but give it a try and let me know if it works for you.
1. Make your page a draft. This keeps it out of page navigation including the page sidebar widget.
2. Copy and paste the permalink located on “Edit Page” into a new window or tab.
The page should show up but not be navigable from the main nav or widget. BTW, I’m using wordpress.com rather than .org.
Cheers!
August 3rd, 2009
Thanks for the idea, April.
Draft pages won’t display though unless you’re logged into your blog. So you can see your draft and you might be able to go to it by entering the permalink, but nobody else would be able to go to that page until it was actually published.
Same with scheduled posts. I was working on something else a while back and thought I had them displaying, but then I logged out and refreshed…
August 3rd, 2009
@Shawn – Well, gosh darnit, you’re right! Which is odd because one friend was able to see it even though she doesn’t have admin access to my blog but my other friend couldn’t. I’m messing around with “visibility” options to see if that doesn’t work.
BTW, my scheduled posts aren’t showing up. Had to contact WP this morning about it. *le sigh*
August 5th, 2009
@April – Figured it out and even made a tutorial on my example portfolio site.
WP doesn’t use subpages in the main navigation. So, just make sure whichever page you want to hide is a subpage. This works particularly well if you want to include a static landing page as the home page to avoid the double home tab/links that happen occasionally.
If you get a moment, feel free to check out the tutorial (it’s short and sweet):
http://portfoliotest123.wordpr.....o/mainnav/
August 5th, 2009
Whether or not subpages appear in the site nav depends on the theme you’re using.
There are several themes that do display the subpages (Thematic, just 1 example) and use drop down menus to display the subpages.
If you use the wp_list_pages template tag, subpages are displayed by default. You have to specifically tell it not to show them.
But if you have a theme that doesn’t show subpages, your idea would work.
August 17th, 2009
wow..great tutor..this what I’ve been searching for..thanks a lot for the info
August 17th, 2009
I’m glad to help!
August 29th, 2009
Thanks mate. Seriously helped, needed this damn bad :)
August 29th, 2009
Glad to help
October 26th, 2009
Well, this is kind of what I was wanting, and kind of not.
It works to exclude pages from the navigation bar at the top of the page, which is what I want, but it’s also excluding the pages from the side bar, which I don’t want. I want to keep the links in the side bar.
I guess this is a theme issue and I’m just stuck with this delimma unless I change themes altogether and I’ve put in so much time in this so far it’s just frustrating. :/
October 26th, 2009
I’m not sure why you need want 2 sets of navigation, but if you need only a specific set of links in the sidebar, you might try placing links in a blogroll and use the blogroll/links widget.
Of course, if you’re familiar with PHP, you could just edit the theme yourself and exclude a particular page.
You might try asking the author of the theme you’re using for suggestions if they have a forum or comments section for their theme.
October 26th, 2009
That’s just it. I don’t need two sets of navigation. I guess it just comes with the theme and I’d like to get rid of the one at the top and keep the one on the side.
I don’t really know code, but I’m planning to learn, and in the mean time I was looking for a quick/easy fix.
Thanks for the reply, that was super fast! a+++++
I might try to contact the developer, but I doubt they’ll be as friendly and quick to respond heh.
October 27th, 2009
Yeah, heh, not hearing back from the developer. I found a code yesterday that was supposed to edit out that nav bar, but it doesn’t work and I can’t find it now to show you.
November 11th, 2009
This seems to be working fine in The 2.8.5.2 version of WordPress MU….
Thanks Awesome Plug In….!
November 11th, 2009
Good to know, James. Thanks for the update, and I’m glad you like.
January 13th, 2010
thank you so much.. it is very helpful..
an absolute solution indeed =)
Subscribe to the Comments RSS feed—Follow the discussion.
Leave a comment
Note: All links in the comments are set to 'nofollow'. Search engines will not follow or index those links.
Follow this post's comments by subscribing to the Comments RSS feed.