Can YOAST SEO fields be removed from custom post type [duplicate]

So as noted in the comments above, I found a solution and used this code to do it:

function remove_yoast_metabox_reservations(){
    remove_meta_box('wpseo_meta', 'reservation', 'normal');
}
add_action( 'add_meta_boxes', 'remove_yoast_metabox_reservations',11 );

In this instance, “reservation” was my custom post type. And “wpseo_meta” was the ID of the metabox. So the same code can be used on any meta box on a post, page, cpt, etc.

Also credit belongs to Mamaduke for his post here: https://wordpress.stackexchange.com/a/62579/12691

Leave a Comment