10

The Yoast SEO plugin is great, but it seems to appear in more places then wanted (columns, custom post type pages, etc.). I want to remove this option because as it stands even when I ignore the fields if I save my custom post type I get several fields added to my database.

_yoast_wpseo_google-plus-description
_yoast_wpseo_linkdex
_yoast_wpseo_opengraph-description
_yoast_wpseo_redirect
_yoast_wpseo_canonical
_yoast_wpseo_sitemap-html-include
_yoast_wpseo_sitemap-prio
_yoast_wpseo_sitemap-include
_yoast_wpseo_meta-robots-adv
_yoast_wpseo_meta-robots-nofollow
_yoast_wpseo_meta-robots-noindex
_yoast_wpseo_metadesc
_yoast_wpseo_title

So the goal is to not have them appear on the admin page at all so that they are not entered as values. Thanks in advance for any help with this

4
  • Just remove the meta boxes. Look up the source code where the get added, note their handles and then remove_meta_box() in some custom plugins.
    – kaiser
    Aug 2, 2013 at 10:03
  • The point isn't to edit the plugin, also, I don't want all meta_boxes removed, just within certain CPTs. I figured maybe there was a filter or something someone knew about Aug 2, 2013 at 20:23
  • There is one in core: add_meta_boxes and similar (search core code base). Then just remove the meta boxes with above mentioned function. Try it, update your question with some code.
    – kaiser
    Aug 3, 2013 at 12:28
  • The answer was actually found here: wordpress.stackexchange.com/a/62579/12691 Aug 5, 2013 at 22:09

1 Answer 1

23

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.