Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save atomtigerzoo/7b32bd26668e9f471e503c85e345e942 to your computer and use it in GitHub Desktop.

Select an option

Save atomtigerzoo/7b32bd26668e9f471e503c85e345e942 to your computer and use it in GitHub Desktop.
Wordpress: Disable Yoast SEO on Custom Post Type
function my_remove_wp_seo_meta_box() {
remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal');
}
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100);
@andredaniel

Copy link
Copy Markdown

Perfect!

@davehamer

Copy link
Copy Markdown

Thanks!

@alex-ahumada

Copy link
Copy Markdown

Thanks!

@meetawahab

Copy link
Copy Markdown

@alexapgutierrez

Copy link
Copy Markdown

It works, thanks :)

@hayatbiralem

Copy link
Copy Markdown

Thanks :)

@majdadju

Copy link
Copy Markdown

Thanks!

@geochanto

geochanto commented Apr 29, 2019

Copy link
Copy Markdown

I found that I can use this for multiple post types as well. just pass an array as the second argument:

function my_remove_wp_seo_meta_box() {
	remove_meta_box('wpseo_meta', ["Post_Type_1","Post_Type_2"], 'normal');
}
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100);

@ipatovstyle

Copy link
Copy Markdown

I found the answer without coding
111

@simplenotezy

Copy link
Copy Markdown

If you'd also like to remove the "Internal Linking" seo box below, use this:

remove_meta_box('yoast_internal_linking', 'your_post_type_here', 'normal');

image

@MrSiir

MrSiir commented Jan 7, 2021

Copy link
Copy Markdown

Thanks!

@glebkema

Copy link
Copy Markdown

Thanks!

@ArneSaknussemm

Copy link
Copy Markdown

Thanks!

@ScottJFreeman

Copy link
Copy Markdown

I found the answer without coding
111

This hides it everywhere, not just for a specific custom post type.

@mfru

mfru commented May 3, 2022

Copy link
Copy Markdown

image

It is possible to disable Yoast granularly now, also for custom post types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment