Plugin Support
Yurii
(@yuriinalivaiko)
Hi @sarahtopfstaedt
You can add the pages you want to excluded URLs in the content restriction settings (Ultimate Member > Settings > Access > Restriction Content)
More detailed information about content restrictions settings can be found here – https://docs.ultimatemember.com/article/1736-content-restriction
Regards.
Unfortunately, add every single page doesn´t work for us: We have to exclude around 100 single pages, so that`s not possible to do manually in our daily schedule.
@sarahtopfstaedt
You can try this code snippet, which temporarily adds the current URL
to the “Exclude the following URLs” list if /hilfe/ is present in the URL.
The UM settings will not be updated and current subpages may be removed.
add_filter( 'um_get_option_filter__access_exclude_uris', 'add_access_exclude_uris_parent_childs', 10, 1 );
function add_access_exclude_uris_parent_childs( $options ) {
$parent_page = '/hilfe/';
$current_url = UM()->permalinks()->get_current_url( UM()->is_permalinks );
if ( str_contains( $current_url, $parent_page )) {
$options = array_merge( $options, array( $current_url ));
}
return $options;
}
You install the code snippet by adding it
to your active theme’s functions.php file
or use the “Code Snippets” Plugin
https://ww.wp.xz.cn/plugins/code-snippets/
Plugin Support
Yurii
(@yuriinalivaiko)
Hi @sarahtopfstaedt
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards
@sarahtopfstaedt
I have added an UM new feature request for the UM developers about your issue.
https://github.com/ultimatemember/ultimatemember/issues/1702