subscribe: Posts | Comments | Email

How To Exclude Pages From WordPress Navigation Bar

View Comments

Have you ever wanted to create a page on your WordPress site that doesn’t display on the navigation bar or even in the sidebar or footer areas? Yet you still want the pages you create to be easily accessible and search engine friendly so you don’t want to password protect them or make them private. Well, you can do all of this by excluding pages and I’m going to show you EXACTLY how to to do it.

I have about 8 pages on this very site but only 5 of the are visible on the navigation bar. None of the pages you don’t see have any type of privacy settings. The remaining ones are used either as thank you pages for when somebody subscribes to my blog or they are pages built for other marketing purposes.

Pages are displayed using this code. (primarily used in the header, footer and sidebar)

<?php wp_list_pages();?>

This little piece of code will list all of your pages until you add conditions between ‘()’. What you need to do is find out the unique ID of each page and then add the exclude condition. But in order to do that we must find out you page IDs. Here’s how you do that.

Go to Pages > Edit in your WP Admin and select the name of the page you want to exclude. Edit that page and you will see the unique ID for that page listed above in the address bar. It will looking like this.

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

The number at the end, 24, is the unique ID of that page and is the number you will need to use in the exclude code. You can do this for every page you want to exclude as long as you put a comma between then in the code. Here’s what it might look like.

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

Now if you’re not a WordPress junkie or just straight up don’t care for PHP then you are probably thinking this stuff is WAY to complicated for me.

You might even want to know if you can ask “WHY isn’t there an easier way?”

Well the answer is YES THERE IS! (man, asking questions are great huh?!)

And here it is my friends. It’s called the ePanel and it will take care of EVERYTHING that would normally have to be coded into your WordPress blog/website before now. My good friends over at Elegant Themes have designed the whole system for you and its incredibly simple to use.

Want to exclude a page with the click of a button? Just click the green check mark and its done…

ePanel

If you want THE best themes around with simple integration, easy navigation, and great support then you have to check out Elegant Themes.

If you enjoyed this post, you might also like my eBook Article Cannon

If you haven't got it yet, you may want to download this private interview with Frank Kern. Thanks for visiting!

Related Posts

468 ad
  • I love it!! I'm ready to exclude a thank you page on my blog! The fact that I opened up your site of all the sites in the world and scrolled down right to this post is amazing! I will learn it! I never in a million years thought I'd be interested in learning this! And I'm loving it! Thank you for teaching me! One of my biggest lessons is patience! Learning was faster for me in my earlier years, but it is just as fun!
  • hackmanj
    Very useful post Matthew. I needed to know how to do this. Thanks for the great info!
  • You're welcome Joe. My pleasure, hope you can spread the news so others can benefit as well.
  • dave
    you can also use a plug-in which does a lot of this for you. with this, all you have to do is uncheck a checkbox while editing your page's content

    http://wordpress.org/extend/plugins/exclude-pages/
  • Hey Dave,

    Thanks for the tip man. I actually didn't know there was a plug-in out there for that but it figures there would be. You can find just about anything you need these days...
  • mcinpat
    This helped me get my secret pages up! Thanks Matthew!
  • Lol, you know how everybody likes secret stuff. That's awesome man, glad I could help out.
  • scottphares
    Good information to know, thanks Matthew!
  • Good stuff Matthew. I've actually been wondering about this lately!

    Thanks for the resource!
  • Great post. By excluding pages on your Wordpress Blog, you can basically create private websites.
blog comments powered by Disqus