Archived topic
How to fix issues in creative work (google structure data testing tool)
41 replies · Started by Soumyadip on October 26, 2018
That code is new in GP 2.2, and was introduced towards the end of the betas.
Glad it's working :)
Hi tom one more thing.. i just looked into this article https://docs.generatepress.com/article/json-ld/ will i have to implement the below code ?
add_filter( 'generate_json_ld', function( $data ) {
if ( is_singular( 'recipe' ) ) {
$data['@type'] = 'Recipe';
$data['name'] = get_the_title();
$data['prepTime'] = get_post_meta( get_the_ID(), '_my_prep_time_field', true );
$data['cookTime'] = get_post_meta( get_the_ID(), '_my_cook_time_field', true );
}
return $data;
} );
Because i am also running a food blog...
Plz help me with this...
That code no longer applies, as we pulled the JSON-LD option before releasing 2.2.
Wanted to work on it some more before releasing it to the wild.
Thanks tom just waiting your next amazing updates...
Thanks! :)
Hi tom one thing I forget is "Hatom" is still showing there have a look...http://i.is.cc/N1cx3ej.png
Let me know how to remove that too..
hatom is added using classes within certain objects. It's not possible to remove those as of now.
Ok.. but having hatom in the schema is good or bad.. any bad seo effects?
Definitely not. We wouldn't add anything to theme that would hurt SEO :)
Hi Tom, any updates regarding htom (it's almost a year), it's still showing https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fwww.allchickenrecipes.com%2Fchicken-salad-with-grapes%2F
Let me know how to remove that
Does adding this function make a difference?:
add_filter( 'post_class', function( $classes ) {
$classes = array_diff( $classes, array( 'hentry' ) );
return $classes;
} );
Naah, no difference! I also tried to replace "hentry" with "hatom" in your code.. but still hatom is showing in the testing tool.
Is that code still active (with hentry)? If not, can you re-add it?
Ok, I have re-added the exact code of yours.
You can have a look
Looks like that removed most of it. The only remaining parts are the tags. Out of curiosity, if you disable tags in Customize > Layout > Blog, does it remove the remaining hatom stuff?