Created
December 19, 2022 02:47
-
-
Save majeedraza1/dc0c6c04ac67dfe80da54dcf0140eb5f to your computer and use it in GitHub Desktop.
Remove Yoast SEO metabox from a custom post type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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