Skip to content

Instantly share code, notes, and snippets.

@mattiasghodsian
Last active April 28, 2023 08:37
Show Gist options
  • Select an option

  • Save mattiasghodsian/4a0842f4ac39744474fbdb12f0141b38 to your computer and use it in GitHub Desktop.

Select an option

Save mattiasghodsian/4a0842f4ac39744474fbdb12f0141b38 to your computer and use it in GitHub Desktop.
Remove yoast bredcrumb ld+json
/**
* Title: Remove yoast bredcrumb ld+json
* Author: Mattias Ghodsian
* Description: This removes the schema (json+ld) from yoast
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
**/
function remove_yoast_breadcrumb_json_ld($data)
{
if ( $data['@type'] == 'BreadcrumbList') {
$data = "";
}
return $data;
}
add_filter('wpseo_json_ld_output', 'remove_yoast_breadcrumb_json_ld', 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment