I needed to hide a page from the page list – the header panel that shows all of the main site pages. Problem was that I needed it accessible to users via links but not listed in the main header. This page from a google search helped me out:
The last way is to hardcode your menu function. WordPress created the menu with this function: wp_list_pages();
You can either remove that function and add your own links, or add the "exclude" argument to wp_list_pages() like so:
wp_list_pages(exclude=17,38);
So my header.php code ended up looking like so:
$pages = wp_list_pages('sort_column=menu_order&title_li=&echo=0&exclude=377');
$pages = preg_replace('%]+)>%U','', $pages);
$pages = str_replace('','', $pages);
echo $pages;
?>







I’m not a fan of wordpress, but in the replacement code you have “$pages = str_replace(”,”, $pages);” which is useless. You just relace nothing with nothing. You might have write it wrong. Cheers!
Actually it’s supposed to read as
"$pages = str_replace('< /a >','', $pages);"but showing the href tag without the spaces. For some reason the code markup doesn’t disregard href tags and that was getting blown out to look like it was not doing any replacing. So it is doing something once wordpress doesn’t screw it up. Thanks for reading!