How to Disable Yoast Generated Schema Data

By April 1, 2018 2 Comments

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?

    • Prodjex says:

      Hmm…not sure I follow your question, are you talking about Google Tag Manager?

      You could test easily by add the code then viewing the source on your page and running a search for “”

Leave a Reply