Missing field "image"

Created on 27 May 2023, over 1 year ago
Updated 30 May 2023, over 1 year ago

Problem/Motivation

I'm facing an issue with Google Search Console and Rich Results Test. The problem is related to missing field image for multiple pages on my Drupal site. Here's what I've observed:
Google Search Console reports the missing field image for several pages.
When I copy the `<head>` section of one of the pages into the `<> CODE` option of Rich Results Test, it shows no issues.
However, when I pass the entire HTML file, including the `<body>` section, to Rich Results Test, it gives the same error as Google Search Console.
Rich Results Test indicates that there is a missing field image that is located in the body of the page where the image is.
This is the Drupal generated code I believe the error is referring to:

<div class="node__content">
<div class="layout layout--onecol">
<div class="layout__region layout__region--content">
<div class="block block-layout-builder block-field-blocknoderecipefield-image">
<div class="block__content">
<div class="primary-image field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="field__item"> <a href="/potato_cheddar_chowder"> <img srcset="/sites/default/files/styles/max_325x325/public/2023-05/Potato-Cheddar-Chowder.jpg?itok=pQOSg53z 325w, /sites/default/files/styles/max_650x650/public/2023-05/Potato-Cheddar-Chowder.jpg?itok=GnnX2F0g 640w" sizes="(min-width: 1290px) 1290px, 100vw" src="/sites/default/files/styles/max_325x325/public/2023-05/Potato-Cheddar-Chowder.jpg?itok=pQOSg53z" alt="Piping hot bowl of Potato Cheddar Chowder served on a plate with a fresh home-baked bun on the side." typeof="foaf:Image" />
</a>
</div>
</div>
</div>
</div>

I'm using Drupal 10 CMS with the Recipe, RDF, Metatag and Schema.org Metatag modules.
The json-ld syntax in the head of the page generated by the Schema.org Metatag Module is working with no errors.
I've tried troubleshooting the issue using Safari and Chrome browsers, but the results remain consistent.
I believe I have properly configured each module, directing them to the correct fields.

Steps to reproduce

To reproduce the error, the problematic page and its code can be found at https://www.wilsonwireless.com/potato_cheddar_chowder.

Proposed resolution

I'm seeking assistance in resolving this issue as I suspect there might be a missing configuration or some other factor I'm overlooking. Any insights or guidance would be greatly appreciated.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada gravityBites

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gravityBites
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Moving this to the Schema.org Metatag issue queue instead of Metatag.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Schema.org Metatag's data structures are output in the page header as JSON-LD, what is output in the page's body text is not strictly relevant to the module's output.

    You might disable the RDF module and see if the error goes away.

  • πŸ‡¨πŸ‡¦Canada gravityBites

    As an added question:
    I've noticed the Schema.org module outputs in the<script type="application/ld+json"></script>both the "@type": "Recipe", and "@type": "Article", in the Article and Recipe content types. This causes errors in my Rich Results Test. For example, an article will contain the "@type": "Recipe", and then provides empty recipe tags that Rich Results Test doesn't like. How can I stop the module from producing both the "@type": "Recipe", and "@type": "Article", in all content?

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    To work around that problem (#4) you need to add default configurations for each content type; go to the main Metatag configuration page (admin/config/search/metatag), click the "Add default meta tags" link, select the content type you want to configure, then modify them as needed.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I reviewed the output from the rich results test: https://search.google.com/test/rich-results/result/r%2Fguided-recipes?id...

    It's hard to tell which data structure it's complaining about, because of the duplicate structures. Once you adjust the configuration so each content type has its own configuration it'll be easier to audit the output.

    I also think there's a conflict between the RDF module's output and the JSON+LD output from Schema.org Metatag, if you remove the RDF module it'll also make this easier to review.

  • πŸ‡¨πŸ‡¦Canada gravityBites

    Thank you so much for your help in this matter.
    I will do as you suggested, add default configurations for each content type and remove the RDF module.
    If I run into any further issues with Metatags, I will be sure to ask.

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    You're very welcome! Please let us know how it works out, I'm interested to know.

  • πŸ‡¨πŸ‡¦Canada gravityBites

    Thanks again for all your help. Everything is fixed and now working as expected. However, I had to uninstall the recipe module in order to uninstall the RDF module, as the recipe module was dependent on it. But I managed to recreate the recipe content type and am pretty happy with it. I now have to start re-entering the recipes, but fortunately, I have only had twelve entered so far, so it won't be a huge task.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Oh, I didn't even think of that, I figured the recipe content type was something you manually created.

    Glad it's working correctly with just the Schema Metatag module suite.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024