Try adding this to your child theme’s functions.php or a custom functions plugin:
add_filter( 'be_subpages_widget_args', 'be_subpages_exclude' );
function be_subpages_exclude( $args ) {
$args['exclude'] = '123,234,345';
return $args;
}
Where the numbers in the array are the page IDs of the pages you want to exclude. I’ve not tested this yet but I think it should work.
I came up with a simpler hack – since I only need to display the top level of subpages I set the pages where I wanted no links displayed as children of a subpage, and hid the nested ul in the css. For example, a ‘thank you’ page might be a child of a ‘checkout’ page, which is in a set of pages under ‘store’.
.widget_subpages ul ul{display:none;}
cubecolour that worked perfectly. I even added an ACF option so you can select the pages to exclude globally with the relationship field. Here is the updated code
add_filter( 'be_subpages_widget_args', 'be_subpages_exclude' );
function be_subpages_exclude( $args ) {
$excludes = get_field('exclude_from_sub_menu','option');
$exclude = implode(',', $excludes);
$args['exclude'] = $exclude;
return $args;
}