So, you want to hide some of your WordPress pages from your navigation?

There are a couple of good reasons why you may want to do this, especially if you are using WordPress to manage a content website. Here are some examples of pages you may want to hide from the regular page navigation bar.

  • Newsletter Signup Thank You Pages
  • Product Download Pages
  • Affiliate Signup Or Tools Pages
  • Free Downloads Or Bonuses You Want To Send To Your Lists

No matter what you’re reason for doing this, here are two different ways to hide those pages from your site navigation.

Manually Editing Your WordPress Template To Hide Pages

I usually manually edit my wordpress template to hide pages. It’s pretty straightforward and after you’ve done it once or twice, it becomes second nature.

I start by creating a main “hidden page”. This page won’t be seen, so name it whatever you’d like. If you are hiding download pages, you may want to name it download or hidden or something along those lines. You can keep the page blank. Publish it, then go to your list of pages (by clicking on “pages”  or “edit pages” in the left-hand sidebar in your admin area. Hover over each page and you will see the ID for it in the status bar in the bottom of your browser. It will be part of the ULR and include something like “post=1234″.

Once you have that page ID, head on over to the theme editor (under Appearance  in your admin area). Depending on where the pages appear in your navigation, you’ll have to look for the code to edit in either the header or the side bar files. Look for the following line of code:

<?php wp_list_pages();?>

Sometimes it will include a little extra code and look more like this:

<?php wp_list_pages (‘title_li=&depth=4&sort_column=menu_order); ?>

Now we’ll just need to include a little code to hide our page from this navigation menu. In our example, the page id was 1234. We’d modify the basic code as follows:

<?php wp_list_pages(“exclude=1234″);?>

The second code example would look like this:

<?php wp_list_pages (‘title_li=&depth=4&sort_column=menu_order&exclude=1234′); ?>

If you have more than one page to exclude, you simply add it separating the page ids with commas. Here’s an example:

<?php wp_list_pages(“exclude=1234,1235″);?>

The reason I’m creating a main hidden page is so I don’t have to go in and manually edit my template each time I create a new hidden pages. From here on out I simply make the main hidden page the parent of this new page (it’s one of the options when you create a new page) and the new page will automatically also be hidden.

Using A Plugin To Hide Pages In WordPress

If hand-coding the php code in your templates isn’t quite your thing, there’s a wordpress plugin that will do the job for you. It’s called “Exclude Pages” and you can download it from the WordPress.org site here. Once you have the plugin uploaded and activated, you will see a little option and checkbox that will allow you to specify whether or not a particular page on your blog should be included in the site navigation or not.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}