Posted on 11 September, 2008 By Kim Woodbridge 78 Comments

How to Exclude Pages from the WordPress Navigation Bar

Excluded (by malias)

Have you ever wanted to create pages in WordPress but don’t want them listed in the header or footer navigation areas? You still want the pages to be accessible, perhaps listed in the sidebar, so you don’t want to make them private. You can do this by excluding pages and I’ll show you how to do it.

I have seven pages on this site but only 4, plus the home page, are listed in the header and footer. None of these pages have privacy settings. The remaining three are listed in my sidebar as links rather than in a list of pages. Do you know which ones they are? They are Bookmarks, Friendfeed Lifestream, and RSS Stream.

Pages are displayed with the following code, which is generally used in the header, footer, or sidebar.

<?php wp_list_pages();?>

This will list all of your pages until you add conditions in between ‘()’. You need to use the exclude condition and find out what number ID each page has. The exclude code looks like

<?php wp_list_pages('exclude=17,38' ); ?>
You can see that you have added 'exclude=17,38' to the original
list pages code.

Of course, we need to locate the correct ID numbers for your pages.

Go to Manage > Pages and select the name of the page in which you would like to exclude. In the address bar of your web browser will be a URL that looks like the following.


http://www.yoursite.com/wp-admin/page.php?action=edit&post=96

The number at the end, 96, is the ID number for the page and is the number you will use in the exclude code. You can do this for each page that you want to exclude as long as you put a comma between the page numbers in the code.

Are there other tweaks that you would like to add to your list of pages? Ask me about them in the comments and I will answer your questions. Or if your comment really inspires me I will write an entire article about it :-)

photo credit: malias


Related Posts:
  • WordPress How To: 5 Tips and Tricks
  • How to Exclude a Category From the Sidebar List in WordPress
  • WordPress – Collapsible Archives with the Clean Archives Reloaded Plugin
  • How to add a RSS Feed to a Post or Page Using a WordPress Shortcode
  • How to Add a RSS Feed Without a Plugin Using the WordPress Fetch Feed Function
  • Posted In : WordPress Tips
    If you enjoyed this post, please subscribe to my RSS Feed

    Post to Twitter   Post to Delicious   Post to StumbleUpon

    78 Responses to “How to Exclude Pages from the WordPress Navigation Bar”

    Trackbacks/Pingbacks
    1. Question for My Readers - What Wordpress Tips Would You Like Me to Write About? | (Anti) Social Development
    2. WordPress - How To Create a Delicious Bookmarks Page | (Anti) Social Development
    3. How to Exclude a Category From the Sidebar List in WordPress | (Anti) Social Development
    4. A Privacy Page! : Web Career Girl
    5. 5 Most Popular (Anti) Social Posts of All Time | (Anti) Social Development
    6. Wordpress - Pages vs Posts ?
    7. Removing Pages From Navigation in WordPress | Es Developed - Fresh Website and Graphic Design
    8. how to add a hidden page in wordpress? - Blogging & Business Forums
    9. PHP Referrer: Displaying The Referring Page
    Leave a Comment
    You may use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .


    Recent Comments

      • David Bradley: Another missing feature is the ability to add members who are fans as friends - via the list of fans. We can make people...
      • Ajith Edassery: Did that after I posted the query... I had to browse some FB discussion forums to figure that out lol.. thanks anyway. ....
      • Kim Woodbridge: Hi Ajith - I've found that due to too many friends and less free time that it's really difficult to keep up with it - it...
      • Kim Woodbridge: Hi David - It really is a mess. And if they would get it in order it would be a much more valuable way to follow news. ...
      • Ajith Edassery: Btw, how to remove these lists? Dang, I have some old lists that I wanted to remove. .-= Ajith Edassery´s last blog .....
      • Ajith Edassery: Nice tip Kim. I am already having as many as 6 lists. However, I still find it difficult to easily read updates. In prin...
      • Kim Woodbridge: Hi Dennis - Apparently it took months and numerous takes. I love it when they smash the tv ;-)...
      • Dennis Edell: Well now, there's 4 minutes I'll never get back. LOL! Setting that up woulda drove me mad I tell ya. .-= Dennis Edell...