Sometimes when creating a new page, we do not want the page appears on the page navigaton menu. WordPress itself does not provide that option when creating a new page. To apply it, we must change it manually in the header.php file located in the current active theme directory.
How to apply:
- Create a new page and publish it
- Edit the header.php file located in the current active theme directory
- Find the wp_list_pages function, add the argument exclude = id, where id is the id of the page that will be excluded. Use commas to separate each id if you want to exclude more than one pages, e.g. wp_list_pages ( ‘exclude = 20,21’).
- To get the id of each page, go to the Edit Page menu, place the cursor on the edit link and get the id of the page found on the page url (wp-admin/page.php?action=edit&post=20).