I would like to remove the JSON-LD schema that Yoast applies to my WordPress site so that I can add my own. I have already added my own, and Google Structured Data Testing says that it is OK, but basically I have 3 separate JSON-LD schemas instead of two because of Yoast.
You can see what I mean here: https://search.google.com/structured-data/testing-tool/u/0/#url=http%3A%2F%2Fwww.yogabearpc.com
Yoast has added the WebSite
schema and it seems unnecessary or even damaging?
4
Answers
Unless the data Yoast produces is wrong, there is no harm in having it. Quite the contrary, having more structured data is better than having less.
If having it is “unnecessary” depends on your definition of what is necessary. Some consumers might be interested in it, others not.
My guess is that Yoast adds a
WebSite
entity because of Google’s sitelinks searchbox rich snippet result, which allows Google users to search your site directly from the Google search result.I wanted to disable this because of the sitelinks searchbox and the fact that I don’t have a search function that works globally, just on the blog. Having the search box enabled for me would have undesirable effects.
The easier option may just be to prevent Google using the sitelinks searchbox without having to touch the functions files. You can prevent Google using sitelinks searchbox on your site by using the following meta:
If you want to disable Yoast’s JSON-LD all together then here’s a snippet from my blog and the code I use on my site:
Simplest way to completely disable the Yoast SEO schema JSON-LD
Add this line to
functions.php file
:add_filter( 'wpseo_json_ld_output', '__return_empty_array' );
Source
If you want to disable just Organization or just Website, add this to your theme’s
functions.php
file: