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.

If you are not familiar with editing code you can simply use a plugin called Exclude Pages to easily hide pages in WordPress menu. You can alternatively read our article on Important Safety and Security Tips for WordPress Bloggers.

Rahul is the Editor-in-Chief at Thetechhacker, PhoneSetter and TheWearableNews. After realizing an obsession with technology, he left his job career to write about technology.
We will be happy to hear your thoughts

      Leave a Reply

      Thetechhacker
      Register New Account
      Reset Password