Excluding Pages from display in WordPress
I was kind of having to search a lot for this change on the net and finally figured it out. For the benefit fo those who might face a similar issue here it is!
Here is how the menu code probably looks in your theme:
<?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’);?>
If you have a individual page you’ve created, but don’t want to display it in your blog’s menu, you simply need to add an exclude command and the page number (this can be found on Manage -> Pages) to your existing code. Here is how the same code would look if I was excluding page 102:
<?php wp_list_pages(‘depth=1&sort_column=menu_order&exclude=102&title_li=’ . __(”) . ” ); ?>
If you’d prefer to exclude more than one page, you can do so by simply adding a comma between each page number like so:
<?php wp_list_pages(‘depth=1&sort_column=menu_order&exclude=102,113&title_li=’ . __(”) . ” ); ?>
This code will exclude pages 102 and page 113 from your page menu.
Any other questions? Feel free to post them below.
Filed under: technical


