Your page navigation menu uses the WordPress wp_list_pages tag to display all of your Pages. There are, however, some Pages that are necessary, but you would prefer not to include in your navigation menu such as “Privacy Policy” or “Thank You for Shopping With Us” or “Legal Disclaimers.” How do you tell WordPress to exclude those Pages from your navigation menu?

Well, you could simply manually create your navigation menu, but that defeats a large part of the value in a CMS-based site and would be…well, to be honest, plain sutpid. So we need to tell  wp_list_pages tag in our template what Pages to exclude (i.e., leave out).

In whichever template  your page navigation list appears (usually header.php or sidebar.php), you will see a bit of code that looks something like this:

<?php wp_list_pages('depth=1&sort_column=ID&title_li='); ?>

This is the chunk of WordPress code that displays all of your Pages (not your Posts, but your Pages; and if you don’t know the difference between Pages and Posts, please download the tutorial the Beginner’s Guide to WordPress 2.7 and read that bit – it’s important!). To prevent WordPress from listing a particular Page, you need to tell WordPress what to exclude.

In your wp_list_pages tag you want to add to text &exclude=THE-ID-NUMBER-OF-PAGE-TO-EXCLUDE so that your code looks something like this:
<?php wp_list_pages('depth=1&sort_column=ID&exclude=290,299&title_li=’); ?>

Where did I get the ID numbers of the 2 Pages I wanted to exclude?
Another good question!

Click on Edit in your left-hand Pages navigation sub-menu of your WordPress Administration.
You will see the list of your Pages.
Hover your cursor over your Privacy Page listing. Don’t click, just hover.
At the very bottom of your browser window – and I do mean the Very Bottom – in the left-hand corner, you should see the URL to that Page. It will look like this:


That number at the end, your post number, is what you want. This is the number you want to exclude.

How To List Your Privacy Policy (or Other Page) in Your Footer (or Where Ever)

You are going to be so disappointed in me… I cheated. Here’s what the code looks like:

<a href="" name="privacy-policy" title="privacy policy" target="_self">Privacy Policy</a>

Yep. I just created a basic link to the Privacy Policy page. It’s so much easier and faster.

Well, Tom, I hoped that helped. And thank you again for stopping by.

Please do me a favor and link to the site and add it to your favorite social media.

Click here to opt-out of Google Analytics tracking.