
You may have noticed that many WordPress themes automatically come with a navigation bar either near the top of theme or in the sidebar. By default, most of themes will automatically list all the WordPress pages that you have in alphabetical order. This seems like it could be very convenient, but what if you have pages that you don’t want to have featured near the top of your blog.
Earlier this year, Google announced that all AdSense publishers are required to have a privacy policy on their sites. More likely than not, you would want to use a WordPress page on your blog for your privacy policy, but at the same time, you may not want to have it featured at the top of the site. How can you exclude that page.
It’s actually quite a simple process, actually. Go into the header.php (or sidebar.php) file in your WordPress theme and look for this string:
<?php wp_list_pages(‘title_li=&depth=2′);?>
You may or may not have the “depth=2″ portion. Don’t worry about that part.
To exclude a specific page that you have created, first find out what is the page ID. You can do this through the “Manage” part of the WordPress dashboard. Find the page that you would like to see excluded and hover over its title. You will see that the URL for editing that post ends in something similar to “?action=edit&post=300″. It is the “300″ that you are interested in. After finding out this number, go back to the previously discussed string in header.php (or sidebar.php) and edit it to look like this.
<?php wp_list_pages(‘title_li=&depth=2&exclude=300′);?>
Of course, you’ll want to replace the “300″ with whatever post/page number is associated with the page that you would like to see excluded. Thanks to Matt for the info.





Club Penguin
July 24, 2008 8:38 am
Awesome tip, and I honestly didn’t know that you now need a privacy policy on your to use AdSense. Is this still the case?