If you have a page in WordPress you do not want to appear on a menu — for example, say you have created a static Home page, but don’t want it to be shown on the main menu, you can add an exclude argument in the menu function.
Find the function which calls your menu, the main menu function appears in the header.php file in the default TwentyTen theme. It looks something like this…
[php]
<?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘menu_class’ => ‘main-menu’, ‘theme_location’ => ‘primary’ ) ); ?>
[/php]
To exclude a page from this menu you would add the following code to the array…
[php]
‘exclude’ => ‘YOUR_HIDDEN_PAGE/POST_IDs’
[/php]
Page and Post ID’s should be comma seperated. So now the menu function looks like this…
[php]
<?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘menu_class’ => ‘main-menu’, ‘theme_location’ => ‘primary’, ‘exclude’ => ‘6,12,18’ ) ); ?>
[/php]
To find your post or page ID, in your WordPress admin go to the post or page you want to hide, as if you were going to edit it. Look at the URL of that page in your browser. It will look like this…
http://your_domain.com/wp-admin/post.php?post=2&action=edit
Your Page or Post ID is highlighted in bold above. In this case the page ID is 2.
Hello Adrain, In latest version of WordPress, there is no editing and we can hide the page from “menus” section