[Support request] Remove WPSP For Non Admin Uses

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Remove WPSP For Non Admin Uses

This topic contains 5 replies, has 2 voices, and was last updated by  Tom 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #7715


    Hi Tom,

    Is there a way to disable WPSP for non-admin users?

    Even when using a permissions plugin like: https://wordpress.org/plugins/capability-manager-enhanced/ I can’t see an easy way to disable WPSP for certain permission levels.

    Any ideas?

    Thank you for your help 🙂



    Hi there,

    Give this a shot:

    add_filter( 'register_post_type_args', function( $args, $post_type ) {
        if ( 'wp_show_posts' !== $post_type ) {
            return $args;
        $args['capability_type'] = 'manage_options';
        return $args;
    }, 10, 2 );

    Adding PHP: https://docs.wpshowposts.com/article/adding-php/

    Let me know 🙂



    Hey Tom,

    I added the code above and can confirm that WPSP is no longer showing for “Authors”.

    How exactly is this code working? When will WPSP show/not show – is it only set to show when “Posts” are allowed?

    Thanks for the code, and thank you for clarifying 🙂



    That code makes it so only users with the manage_options capability (admins) can see the admin area for Show Posts.

    Every user role has capabilities, with manage_options being one of the ones for admins.



    Arrr that makes sense.

    So I could hence enable access to WPSP for say… Editors – by enabling this option https://imgur.com/a/CbmMcLk

    Thank you for the code + explanation Tom! 🙂



    You can change manage_options to any one of these: https://codex.wordpress.org/Roles_and_Capabilities

    No problem! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.