Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save majeedraza1/dc0c6c04ac67dfe80da54dcf0140eb5f to your computer and use it in GitHub Desktop.
Save majeedraza1/dc0c6c04ac67dfe80da54dcf0140eb5f to your computer and use it in GitHub Desktop.
Remove Yoast SEO metabox from a custom post type.
function remove_yoast_meta_boxes( $post_type ) {
$custom_post_type= 'movies'; // Replace this with your actual post type name.
if ( $custom_post_type === $post_type ) {
// remove Yoast SEO metaboxes if present.
remove_meta_box( 'wpseo_meta', $post_type, 'normal' );
remove_meta_box( 'yoast_internal_linking', $post_type, 'side' );
}
}
add_action( 'add_meta_boxes', 'remove_yoast_meta_boxes', 90 );
// Remember to give priority a higher number. e.g. 90 or more bigger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment