Recipe schema automatically reformatting (incorrectly)

#139837
  • Resolved Brandon
    Rank Math free

    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)
    CORRECT

    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)
    INCORRECT - After Saving/Updating

    and this is how it ends up resulting in googles rich snippet test:
    Rich Snippet Test Results

    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??

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    Assuming you are using the latest version of all the plugins and the themes (please update if not yet), please check if the issue is out of a conflict with one of the plugins or the theme you are using.

    To determine that, please follow this troubleshooting guide:
    https://rankmath.com/kb/check-plugin-conflicts/

    Only the site admin would know and your users won’t be affected by this troubleshooting.

    If this doesn’t help, please record a video screencast using a tool like Loom showing the troubleshooting and edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    Please do take a complete backup of your website before sharing the information with us.

    We really look forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Recipe schema automatically reformatting (incorrectly)’ is closed to new replies.