WordPress filter hook · part of WordPress core

wp_list_pages_excludes

A WordPress core filter that 16 plugins also fire themselves, running on 20K+ sites between them.

“Filters the array of pages to exclude from the pages list.”

How to use wp_list_pages_excludes

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_list_pages_excludes', function( $exclude_array ) {
	// Change $exclude_array here.
	return $exclude_array;
}, 10, 1 );

Argument names come from EazyDocs's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

16 plugins that fire wp_list_pages_excludes

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Advanced Sidebar Menu icon Advanced Sidebar Menu10,000+ installs apply_filters( 'wp_list_pages_excludes', wp_parse_id_list( $args['exclude'] ) ) src/List_Pages.php:242
  2. Adminify icon Adminify6,000+ installs apply_filters( 'wp_list_pages_excludes', [] ) Inc/Modules/PostTypesOrder/PostTypesOrder.php:95
  3. EazyDocs icon EazyDocs2,000+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) includes/functions.php:816
  4. WPComplete icon WPComplete1,000+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) public/class-wpcomplete-public.php:1707
  5. List Last Changes icon List Last Changes1,000+ installs apply_filters( 'wp_list_pages_excludes', explode(',', $r['exclude']) ) list-last-changes.php:225
  6. Sitemap with woocommerce icon Sitemap with woocommerce100+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) index.php:211
  7. GNA Post Order icon GNA Post Order100+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) admin/gna-post-order-admin-sortpage-menu.php:187
  8. Documentation icon Documentation100+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) lib/views/class-documentation-renderer.php:465
  9. Custom Page Menus icon Custom Page Menus60+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) template-tag.php:30
  10. All Round Order icon All Round Order30+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) 1.1/all-round-order.php:226
  11. Child pages as boxes with title,content and image icon Child pages as boxes with title,content and image20+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) childpages.php:50
  12. JS Widgets icon JS Widgets10+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) core-adapter-widgets/pages/class.php:160
  13. WP YUI Menu icon WP YUI Menu10+ installs apply_filters( 'wp_list_pages_excludes', explode(',', $r['exclude']) ) wp-yui-menu.php:54
  14. Easy Post Re-Order icon Easy Post Re-Order10+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) files/easysoftonic-my-easy-class.php:375
  15. Tagged Sitemap icon Tagged Sitemap10+ installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) functions.php:24
  16. MindValley Show Last Edited icon MindValley Show Last EditedFewer than 10 installs apply_filters( 'wp_list_pages_excludes', $exclude_array ) mindvalley-last-edited-post.php:139

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.