Simply Hide Pages

A wordpress plugin to hide some pages from wp_list_pages output.

Description

Easy way to hide some pages from wp_list_pages output.
Simply add the custom field 'hide' with any value to your page, and this page will no longer appear on the page list.
You could already do this on the ‘Pages’ widget or by adding the exclude parameter to all your wp_list_pages template tags. But now you can do it directly form the page editor which is, I believe, the best place to do so.

You might want to hide pages if you need some pages to exist but don’t want them to appear on your page list. For instance as Cool URIs don’t change, but some services have been removed from your site, so you write a page explaining where to go to get the equivalent service now. (not a real redirect, but still useful sometimes). Of course you don’t want this page on your page list, you prefer to only have the new services listed ;)

Unlike other more complex plugins, it uses custom field to avoid adding tables to your database.

Installation

  1. Download plugin archive and expand it: simply-hide-pages.zip
  2. Upload simply-hide-pages.php to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. To indicate that a page should be hidden when wp_list_pages() is used, edit the page that you do not want to see and create a custom field with a key of “hide” and value of “true” (or anything else it does not really matter).

Screenshot

Screenshot of the Custom Fields edit form filled with 'hide' key and 'true' value.
Custom field needed on page to hide

wordpress.org

Alternatively you can install the plugin from Simply Hide Pages plugin page on wordpress.org !

11 thoughts on “Simply Hide Pages

  1. Julien Post author

    I just added the screenshot of Custom Fields edit form to show what is needed.

    I’m not native English speaker so maybe my description need to be rephrased, I’m open to some suggestions.

  2. Julien Post author

    Would you mind describing your setup ?
    Especially:
    Which version of WordPress do you use ?
    What you are doing exactly ?
    What are you expecting from Simply Hide Pages ?

  3. karen

    I have two grandchild and several great-grandchild pages I want to hide from the navigation bar. From home, they are hidden. However if I am on another page on the site and hover mouse over the nav bar, the pages are still their. What can I do to hide these pages?

    I am using WP3.01

  4. Julien Post author

    Hello karen,

    I just tested adding a few pages as grandchild and great-grandchild with the default WP 3.0.1 theme (Twenty Ten) and could not reproduce your issue.
    Setting the hide custom field hide them from both the home page and any pages on the site. So unless your theme (or a plugin you use) lists the pages by reading the DB directly instead of using WP’s wp_list_pages function I don’t see what’s wrong.

    Or maybe I did get you wrong, are you describing what you want not what you get ?
    You would like to hide the pages from the home menu only, and leave them in the rest of the site ?
    I’m not sure it’s a good idea as visitors will not expect this behavior, but if that’s really what you want, I can look on how to do it.

  5. Dany

    Hi Julien

    thank you very much for this plugin. was exactly what i was looking for. thank you.
    cheers, Dany

  6. Darwin

    HI, where do you exactly create the custom field with a key of “hide” and value of “true” is it inside wordpress, if so where? I already downloaded your plug-in, thanks, but i can’t figure out how or where to add that custom field.

Comments are closed.