Main navigation

You are here: Home/Guides/Web 101/ How To Easily Exclude Pages From The Menu In WordPress

Last updated on Jun 19, 2016

How To Easily Exclude Pages From The Menu In WordPress

WordPress is a very user-friendly Content Managment System for blogging. Sometimes bloggers or site owners need to create pages for their blogs. Pages are static, they don’t contain any date information in their code. Pages are useful to create static pages for contact us, author information, services, testimonials and etc.

After creating a page in WordPress, it automatically displays them in the menu. If you don’t want to see pages in menu items you can exclude pages easily by applying a simple trick. Find the below-given code in your theme PHP files and replace with the second code.

Find this code:

<?php wp_list_pages();?>

Replace the following code with:

<?php wp_list_pages('exclude=9,10' ); ?>

Here the number 9 and 10 are example numbers, now you can change the numbers to your existing page ID’s that you don’t want to see them in Menu items.