-
Hello,
I am setting up the Recipe schema for a website using Rank Math Pro. I have attempted to build the schema template in multiple ways (based on the premade recipe template provided by Rank Math, from scratch, and by importing example HTML directly from google’s example). I have everything working and generating correctly except for one thing I can not seem to figure out. When I add in the “calories” under NutritionInfo, the schema template automatically restructures itself, and does not even restructure in any proper format that google will recognize without warning.
Example (in Rank Math Schema Terms, it should go:
Add Property Group = nutrition
Add Property = @type – NutritionInformation
Add Property = calories – 0 calories
Add Property = proteinContent – 0 grams
Add Property = fatContent – 0 grams
and so on…
(see screenshot below for an example of the correct format)
However, after saving the schema and updating the post, then going back into that posts schema, Rank Math automatically restructures this to be like so:
Add Property Group = nutrition
Add Property = @type – NutritionInformation
Add Property Group = calories
Add Property = calories – 0 calories
Add Property = @type – NutritionInformation
Add Property = proteinContent – 0 grams
Add Property = fatContent – 0 grams
(see screenshot below to see how it automatically reformats after saving/updating)
and this is how it ends up resulting in googles rich snippet test:
This makes no sense, and when testing with google, it of course results in a warning “Invalid object type for field “calories”” because calories should be under the property group of nutrition not made into its own…
How can I stop this from happening, or is there a piece of code I can add to my functions.php to stop Rank Math from automatically restructuring any part of my schema templates altogether??
The ticket ‘Recipe schema automatically reformatting (incorrectly)’ is closed to new replies.