Home » Welcome Letter From The Publisher

Hiding a Page From Your WordPress Navigation Bar

16 March 2010

This is a long over due public post. I originally only had this as instructions for my tech team but after questions from inquiring minds who want to know (Thanks Sandy:)), I decided to share this on the blog today.

In this post you will learn how to exclude a page you’ve already created from your navigation bar.

Why Would You Want To Exclude a Page From Your Nav Bar?

If you have pages on your site you’d prefer to be hidden from casual browsers, non-paying members (if you want to start a membership site), of it just doesn’t make sense to have it in the nav bar (like a ‘thank you’, your terms of service, your privacy policy, to name a few) you’d want continue to read below.

From your Dashboard…

Under your “Appearance” sub-head, select “Editor”.
When in the Editor, select your header.php file on the right.
scroll all the way down to the bottom of the box with the header.php code and look for a line that looks like this:

<?php wp_list_pages(‘title_li=’); ?>

Between the = and the paste: &depth=4&sort_column=menu_order&exclude=123,456,789,

So it now looks like this:

<?php wp_list_pages(‘title_li=&depth=4&sort_column=menu_order&exclude=123,456,789‘); ?>

Where 123,456,789 represent the other pages you may already have listed there for exclusion.

behind the last comma add the page number you’d like to exclude from your nav bar.

How To Get The Page Number?

When you have created your page hit the preview button. When you look in the URL bar of the preview you’ll see :

http://www.YourWebSite.com/?p=XXXX&preview=true

Where XXXX is your page number.

Note that number and type or paste it where it instructed above in the header.php file.

That’s it! Congratulations you have hidden a page from your wordpress nav bar!

Please leave your questions and comments below.

Love,

Malika

View Comments »

  • sandyalabrams said:

    Thank you so much Malika. This is exactly what I have needed. When you walked me through it the first time I didn't write down the steps and then couldn't remember them.

    Now I can refer to this any time I need it until it is locked in my mind.

    I knew you were awesome!

    Sandy

  • BizSavvyMom said:

    I know EXACTLY how you feel unfortunately! LOLOL. I have done things that were “flukes” the first time by trail and error. Then when I need to do it again or show someone else how to do it I don't remember where to start. It's very frustrating. This is why I caved in a got screen capture software AND audio recorder to help me (and others) keep record of “How-to” do little things like this.

    Glad I could help Sandy! Oh and Liz is posting a video in the group of a recorded she did with me on the same topic for those who are more 'visual' learners.

  • damayanthi said:

    Thank you so much for this Malika. – very helpful

    Damayanthi

  • Malika (author) said:

    You're welcome Damayanthi! Did you need to use this for your site to? At some point I think we all need to and it's a pain to have to do it yourself (can you say out source? LOL) but, when you are a business owner you've gotta do what you've gotta do!

    Malika

  • captainliz said:

    Here Is a link to a video that I did when I was being taught on this principle so for those that are visual here it is…. http://thefreedomflyer.com/how-to-make-a-page-i...
    Thanks Malika for letting me record this for other folks out there that may be struggling on this :)

Leave your response!

You can subscribe to these comments via RSS.

blog comments powered by Disqus