Skip to content

Instantly share code, notes, and snippets.

@davidperezgar
Created November 23, 2015 22:41
Show Gist options
  • Save davidperezgar/743475c368aead94319a to your computer and use it in GitHub Desktop.
Save davidperezgar/743475c368aead94319a to your computer and use it in GitHub Desktop.
Disable Yoast SEO Meta
add_action('add_meta_boxes', 'yoast_is_toast', 99);
function yoast_is_toast(){
//capability of 'manage_plugins' equals admin, therefore if NOT administrator
//hide the meta box from all other roles on the following 'post_type'
//such as post, page, custom_post_type, etc
if (!current_user_can('activate_plugins')) {
remove_meta_box('wpseo_meta', 'post_type', 'normal');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment