I have multi-author website and I am not very comfortable for allowing all members to enter SEO details in the posts they are publishing. I would like this would be visible only to Administrator of the website. Any ideas?
Leave a Reply
You must be logged in to post a comment.
It didn’t say in the API docs on the Yoast SEO plugin site what the
ID
was and I don’t have a copy of Yoast at installed at disposal, but according toyoas-plugin-dir/admin/class-metabox.php
line 144, the meta_box registered is;Which is hooked onto
add_meta_boxes
hook on line 32 of the same file,Of course you could get the ID from the meta box itself on the post edit screen… Anyway.
You can do the following,
…where post type is the post type you wish to apply this restriction too, such as
post
or a custom post type one or more!Should do the trick.
update:
manage_plugins
should have beenactivate_plugins
– ammended.Try pasting this in a plugin or theme
functions.php
file, as per the WordPress SEO plugin (API Docs), by Yoast.To avoid any errors… This checks to make sure the function exists, before attempting to hide stuff, allowing you to deactivate the plugin, and not throw errors.
You may need to hook into
init
for this to properly work, which could be done so like this:You can remove it using the remove_meta_box function.
Notice the 100000 in the add_action, this makes sure that this is done after the WP SEO metabox has been hooked in.
You can use the Adminimize plugin to hide items from users depending on their roles. Have used this myself to hide some Yoast SEO stuff from clients and simplifying the back end.
http://wordpress.org/extend/plugins/adminimize/
Pretty straight forward to use by adding the css selectors for the items you want to hide. Have used it to hide the SEO Page Analysis tabs (#linkdex)
Well there is a setting option on the WordPress SEO by Yoast for disabling the advanced part of WordPress SEO settings for non admins. If you want to completely disable the box then you can use other plugins to remove post editor page elements for non admins, e.g. removing the WordPress SEO box from the post editor for non admins.