Skip to main content


As of the release of Yoast 11.0 on April 16th, 2019 you should use the below snippet to remove the Yoast Schema data:

add_filter( 'wpseo_json_ld_output', '__return_false' );



Yoast SEO is our favorite SEO plugin for WordPress.  It helps you customize all of your search engine data at the page, post and site levels easily.  One thing Yoast now includes is a generator for JSON-LD Schema Data.  It generates it on the fly and inserts into your webpage.  Schema Data is a great way to let search engines know what your page is about.

By default Yoast doesn’t include a setting to disable their Schema Data.  They do an OK job constructing it but some of you may want to disable it completely if you’re using another plugin or method to generate it.

Open your functions.php file from your child theme and drop in this little snipped of code the the last line.

function disable_yoast_schema_data($data){
	$data = array();
	return $data;
add_filter('wpseo_json_ld_output', 'disable_yoast_schema_data', 10, 1);

Save the file and refresh you page, the Yoast Schema Data has been removed from your site.

If you’re running WooCommerce keep in mind it also generates Schema Data.  We wrote an article on How to Remove the Woocommerce JSON/LD Structured Data Format.


  • Vasso Vassiliades says:

    Will this disable schema if implemented with GTM thereafter?

  • David Elstob says:

    1. I’m missing the AMP Publisher logo and getting an error on every post.
    2. Running Yoast, Yoast Glue, and now a Schema plugin.
    3. It seems I have two lots of JSON-LD one in the body – correct – and one in the footer – incorrect.
    4. Google seems to be reading the last one unfortunately.
    5. I have tried turning off Yoast, plus other plugins, but the JSON-LD in the footer persists.
    6. Tried your code above, but it didn’t seem to work – I have a child theme.
    7. I’m puzzled. Any ideas, please?

  • David Elstob says:

    Sorry, I didn’t realise that Yoast and Yoast Glue both submit JSON-LD so I have turned Glue off and I think it works. Thanks so much!!!

  • Chad says:

    This doesn’t seem to be disabling for me as the organization schema is still showing up when validating with the Schema tester. But I may have entered it wrong in my functions.php. Here’s how it looks:

    function disable_yoast_schema_data($data){
    $data = array();
    return $data;
    add_filter('wpseo_json_ld_output', 'disable_yoast_schema_data', 10, 1);

    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;

    // AUTO GENERATED – Do not modify or remove comment markers above or below:


    • Prodjex says:

      I’d bet it’s WordPress or WooCommerce doing this if you have it enabled as well. What’s your website URL?

  • Chad says:

    We’re not using Woocommerce, so it’s either WP or Yoast.

    • Prodjex says:

      Interesting, just took a look and it must be another plugin injecting this code or it’s defined in your template.

      Have you checked the header template file to ensure this isn’t hard-coded?

  • jpungky says:

    it doesnt work, yoast structured data still appears

  • Tim says:

    There is also a plugin to disable Yoast schema called Remove Schema. It can also remove schema markup from other plugins.
    It’s possible to remove it from all pages or just from a specific page.

    • Prodjex says:

      Hey Tim, nice find!

      Looks like a relatively new plugin, but will help people for sure if it works correctly that don’t want to modify at the code level.

      Have you taken a look to see if it is a light-weight plugin or bloated? Just curious if it slows down page loads with a lot of extra code or if it’s nice and light-weight.

  • mansi says:

    thanks it’s work nice

  • Amazing, it works very well

  • Reza says:

    How to remove schema on single page only?

  • Hi,

    It doesn’t work for the website of my client. I added

    add_filter( ‘wpseo_json_ld_output’, ‘__return_false’ );

    in the functions.php of the theme at the bottom. But in the Google Structured Data Testing tool I still see Yoast..

    Can someone please help? I don’t understand why it’s not working.

  • web kashan says:

    thanks its work well.

  • Tried the GTM to stop yoast structure data but it didn’t worked. At the end I installed snip it’s working.

  • Mostofa says:


    How can I understand that the code is working or not? Can you please explain? I have already added the code but couldn’t understand, it’s working or not.

  • RSK_Klue says:

    I tried the code in WP-Config which created an error, then I tried it in functions.php but that did not do anything. Schema in Yoast is still visible. Is there a specific place we need this first code in?

    add_filter( ‘wpseo_json_ld_output’, ‘__return_false’ );

  • gladwin says:

    thanks alot for this 🙂

Leave a Reply