• Home
  • Blog
  • How to Hide Pages in WordPress – A WordPress Tutorial

How to Hide Pages in WordPress – A WordPress Tutorial

How to Hide Pages in WordPress – A WordPress Tutorial

wordpress-logo-shine-300x300

By: Shawn Culver

wordpress-logo-shine-300x300WordPress displays all pages and sub-pages you create in the main menu or the navigational menu of your blog by default. However, there may be situations where you don’t want certain pages being displayed on the main menu but still retain their functionality. Sometimes when you have too many pages in your blog, your navigational menu starts overflowing from one horizontal line into two and more …

In this article, I will discuss how you can hide pages in WordPress and prevent them from showing up on the navigational menu of your site.

Method 1: Edit your theme’s header.php

* From your WordPress Dashboard, go to Appearance and Editor and then select header.php from the options on the right hand side

* Look for wp_list_pages() tag. You will usually find this under a div id of top nav or something else that represents your blog’s navigational menu. This tag usually looks simular to this <?php wp_list_pages(’title_li=&depth=-1′); ?>

* In the code below, I added =&exclude=55,86,731. The 55,86,731 represent the page IDs I want to hide from my navigational menu. You can see the page id numbers in your browser after you save a page as a draft. Note: be sure to save your changes.

<?php wp_list_pages(’title_li=&depth=-1=&exclude= 55,86,731‘); ?>

By making this small addition  to header.php you will now see that the pages you added to exclude will no longer show up in your navigational menu.

Method 2: WordPress Plugin that Hides Pages in WordPress

Another option you can use is the Exclude Pages WordPress Plugin by Simon Wheatley to hide pages in a WordPress blog. This plugin adds a checkbox, “include this page in menus”, which is checked by default. If you uncheck it, the page will not appear in any listings of pages (which includes, and is usually limited to, your page navigation menus).

By using either of these 2 options you will solve your hiding pages in wordpress problem, also be sure to check out some of the other great articles on makecashnow.biz.

Rate This Article:  1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Loading ... Loading …

Popularity: 3% [?]


Leave Comment

Top