Hide Pages From Menu List In WordPress Blog
Sometimes you don’t want to show some of the pages from your wordpress blog under the menu navigation or if number of pages are more then it is not advisable to show all of them over there. There are couple of ways to achieve this in a wordpress blog.
1. Edit the theme file (header.php) or where the Manu navigation is present
In most of the WordPress themes, Menu Navigation Code appears in header.php where you will have to make some changes. The navigation code should be something like this,
1: <?php wp_list_pages('depth=1&title_li='); ?>
You will have to find the Page-ID of the pages which you want to hide from the menu. Page-ID is similar to the Post-ID which you can find by editing the same page from your WordPress admin. The ID will appear in the URL of that edit page.
Change the above piece of code to the below mention code where I have to exclude the page with Page-ID 462 from the Menu List,
1: <?php wp_list_pages('depth=1&exclude= 462&title_li='); ?>
This is one way to hide the page from menu list or wordpress blog.
If you have to hide multiple pages from the menu list, then write the Page-ID of all the pages separate by a comma (,) in the above piece of code. For example, If I need to hide the pages with Page-ID 462, 302,120 then the code would be,
1: <?php wp_list_pages('depth=1&exclude= 462,302,120&title_li='); ?>
That’s it! Now these pages will not appear in the menu list of your wordpress blog. Now we will talk about the second way to see how to hide pages from menu list in a wordpress blog.
2. Use Exclude Pages Plugin
WordPress users always feel good because of the plug-ins provided by different authors. This time it is Simon Wheatley who provided a Plugin named “Exclude Pages” to hide a page from the menu list. Here you will find a check-box against each page by which you can control their appearance on the menu list.
This Plugin is compatible with the wordpress version 2.2.3 and higher. It is tested with 2.7.1 as well.
Plug-ins are always easier to install and use in a wordpress blog where you just need to “Activate” it thru the Plug-in section of the blog admin.Â
By using these techniques, you can manage your pages and theme design as your way and provide the highlight to some important pages by giving them spaceÂ in Menu List.
Hope you liked the trick and it helped you in achieving a nice look for your blog. Don’t forget to subscribe this blog for getting the future updates in your mailbox. Follow me on Twitter to get latest updates and cool tips every hour.