Support » Plugin: SEOPress, on-site SEO » Only display SEO Press metaboxes to admins

  • Resolved onlyonemj

    (@onlyonemj)


    Hello,

    Is there a filter to hide the SEO metaboxes from all roles except the administrator? This will help prevent other users from making damaging SEO settings.

    Best,

    MJ

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,
    you can change this in SEO > Advanced > Security.

    We also have filters https://www.seopress.org/support/hooks/

    this feature is not working for some custom roles.

    I have a custom role set up with https://wordpress.org/plugins/user-role-editor/ The role appears as a checkbox on the advanced > security page, but the meta box appears regardless if the box is checked or not.

    Edit:
    After digging into the code. you are calling is_super_admin() in admin-metaboxes.php before filtering out the selected roles.
    if a user has the ‘delete_users’ permission, WP is considering it a Super Admin.

    According to the last note on https://developer.wordpress.org/reference/functions/is_super_admin/ the use of this function is discouraged as of WP 4.8. and they say to use current_user_can( ‘setup_network’ ) instead. Changing this on line 464 of admin-metaboxes.php resolved this for me.

    Could you please update the plugin with this? Otherwise it’s a great plugin!

    thank you.

    • This reply was modified 2 years, 9 months ago by lozeone.
    • This reply was modified 2 years, 9 months ago by lozeone.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only display SEO Press metaboxes to admins’ is closed to new replies.