This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the page navigation that users see on your site.
Any issues: contact me.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).
Pages which are children of excluded pages also do not show up in menu listings. (An alert in the editing screen,
underneath the “include” checkbox allows you to track down which ancestor page is affecting child pages
in this way.)
It is possible to temporarily pause and resume the effect of Exclude Pages by using the new
<?php pause_exclude_pages(); ?> and
<?php resume_exclude_pages(); ?> templates tags. The following code will show a list of all pages in your site, even those normally hidden:
<?php pause_exclude_pages(); ?> <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> <?php resume_exclude_pages(); ?>
You can also get an array the IDs of the pages which are excluded by calling the function
ep_get_excluded_ids();, you can then use these IDs as you wish (e.g. feed them into raw MySQL queries).
Note to other plugin authors:
The plugin does not operate on wp_list_pages while the user is on an admin page, if this is an issue you can take advantage of the
ep_admin_bail_out filter and create a filter function which returns false to allow Exclude Pages to operate in the admin area.
If your plugins or themes don’t use the standard WordPress functions to create their menus then they won’t work. To get them to work you will need to track down the bit of code in the theme/plugin which gets the pages and change it to apply the filter “get_pages” (I cannot be responsible for any unforseen effects of the changes you make, so please test thoroughly). The change to getting pages will probably look something like this:
$pages = apply_filters( 'get_pages', $pages );
Please contact me if you’re completely stuck and we can discuss possible solutions.
Exclude pages is incompatible with:
Requests & Bug Reports
I’m simply noting requests & bug reports here, I’ve not necessarily looked into any of these.
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Create or edit a page, and enjoy the frisson of excitement as you exclude it from the navigation
This is an error encountered if your server is using PHP 5.6 or above, and if debugging for your site is enabled.
If you’re still using PHP 5.3, it works fine on WP 4.7.3.
It does not appear that the plugin author has any interest in updating this plugin, or I would give it 5 stars.
Any plugin developers who would like to fork and maintain this plugin?
For me this plugin works perfect for hiding pages from the menus. I use the theme Twenty Fourteen.
Thanks a lot.
Yep, the plugin works as expected on WP 4.3.1
What would be nice would be a “global config” setting where we could select either:
All pages/posts excluded as default OR
All pages/posts included as default
So for those of us who are creating a lot of content on a website that can really clog up a Pages widget with unnecessary links.
But if we could exclude all posts/pages as default, then we’d only have to select the handful of pages/posts we want displayed in menus and widgets and everything else would be hidden – a real timesaver.
NOTE FOR THE DEVELOPER: If you’re not able or willing to add this modification, I’ll be happy to get it done. Just reply to let me know.
Contributors & Developers
“Exclude Pages” is open source software. The following people have contributed to this plugin.Contributors
- BUGFIX: Fix deprecated notice when WP_DEBUG is true, thanks hansfordmc
- Tested up to WordPress v3.3
- BUGFIX: Prevent notice from appearing, thanks Ray
- Tested with WP 3.2.1
- ENHANCEMENT: Detects the use of WP menus and advises the user accordingly
- LOCALISATION: Italian translation courtesy of Gianni Diurno
- LOCALISATION: Polish translation courtesy of Pawel, Siedlecki Portal Informacyjnie Najlepszy
- LOCALISATION: German translation courtesy of Meini, Utech Computer Solutions
Dear Non-English Exclude Pages Users,
This release includes the facility for Exclude Pages to be translated into languages other than English. Please contact me if you want to translate Exclude Pages into your language.
Sorry it took so long.
- DROPPED SUPPORT FOR WORDPRESS VERSIONS PRIOR TO VERSION 2.7
- BUGFIX: Everything was reporting that it was excluded by an ancestor for some reason. Crazy. Fixed now.
- LOCALISATION: Added POT file! Woo hoo!
- BUGFIX: Check for existence of parent object before attempting to use it. (Thanks to Robert Kosara for the bug report.)
- BUGFIX: PHP 5.3 doesn’t like the fact that parameters marked as passed by reference as passed as value. Params now not marked as passed by ref.
- ENHANCEMENT: You can now turn the Exclude Pages functionality off in the admin area through use of a filter (this is mainly of advantage to other plugin and theme author).
- ENHANCEMENT: You can now turn the Exclude Pages functionality off before showing navigation which you want to be comprehensive (and show pages you’ve normally hidden). This is done with the new
<?php pause_exclude_pages(); ?>and
<?php resume_exclude_pages(); ?>templates tags.
- FIX: Was throwing an error when $pages turned out not to be an array. Thanks to (Sandra)[http://www.vinyltangerine.com/] for reporting this.
- ENHANCEMENT: Now compatible with WP 2.7-beta1
- DOCS: Added a list of incompatible plugins
- DOCS: Added a list of incompatible themes
- ENHANCEMENT: Now compatible with WP 2.5
- FIX: Pages are also excluded from the “Front page displays:” > “Posts page:” admin menu. (Reported by Ed Foley) This plugin now checks if it’s within the admin area, and does nothing if it is.
- FIXED: Descendant (e.g. child) pages were only being checked to a depth of 1 generation.
- FIXED: The link to visit the hidden ancestor page from an affected descendant page was hard-coded to my development blog URL. (Reported by webdragon777)
- FIXED: Stripped out some stray error logging code.
- ENHANCEMENT: Child pages of an excluded page are now also hidden. There is also a warning message in the edit screen for any child page with a hidden ancestor, informing the person editing that the page is effectively hidden; a link is provided to edit the ancestor affecting the child page.
- FIXED: Pages not created manually using “Write Page” were always excluded from the navigation, meaning the admin has to edit the page to manually include them. Pages created by other plugins are not always included in the navigation, if you want to exclude them (a less common scenario) you have to edit them and uncheck the box. (Reported by Nudnik)