I want to delete website microdata json-ld, and I think I should disable the action in the classWPSEO_JSON_LD
Act:
add_action( 'wpseo_json_ld', array( $this, 'website' ), 10 );
Changes in mine functions.php:
remove_action( 'wpseo_json_ld', array( 'WPSEO_JSON_LD', 'website' ), 10 );
What am I doing wrong?
Decision:
add_filter( 'wpseo_json_ld_output', 'swp_remove_jsonld_yoast', 10, 2 );
function swp_remove_jsonld_yoast($data, $context){
if($data['@type'] == 'WebSite'){
$data = false;
}
return $data;
}
Vital source
share