Home WordPress How to remove pages from WordPress menu?

How to remove pages from WordPress menu?

by Satish Kumar
GUTANN_remove pages, exclude pages from menu, wordpress theme hack, wordpress tutorial

Generally, Bloggers doesn’t create pages what they need the only post, but they don’t want to display the pages in the menu. Today I’ll show you how to remove the pages from WordPress menu.

First, you need to locate WordPress source code to get the filename where the menu is located. Open the file and locate the below code or similar code in the file.

<?php wp_list_pages();?>

You should replace the above code with the following code:

<?php wp_list_pages(‘exclude=5,9’);?>

In the above code, you need to change the page ID with your blog’s page ID, which you don’t want to display in WordPress menu.

You can do the same changes by using plugin also, the required plugin name is “Exclude Pages”.

For more information you can go through WordPress reference site “WordPress codex”.

Don’t forget to subscribe to GUTANN email newsletter to keep update yourself with such posts in future.

Dear learners, if you need any help for your blog you can get the suggestion by commenting below or contact me by using the contact form.


You may also like

Leave a Comment

20 − six =