Yoasts SEO plugin adds a metabox to the post edit screen. I’m trying to remove this for users who aren’t editors or above.
I’ve tried putting a remove_meta_box
call in on admin_init, trying to remove the action on $wpseo_metabox but to no avail.
How do I remove this metabox without requiring user intervention (the user should never know the metabox existed, so clicking on screen options is not an option )
On
remove_meta_box
is a note:WordPress SEO adds meta boxes on
add_meta_boxes
action with default priority – 10, which run afteradmin_init
, so that won’t remove them. Instead you need to hook intoadd_meta_boxes
, but with lower priority – 11, 12, etc.Remove metaboxes for non-admin accounts: