Support

Account

Home Forums General Issues Image set via custom field not beign displayed in Google's schemma.org

Solving

Image set via custom field not beign displayed in Google's schemma.org

  • I’m using the following code:
    "image": "<?php $imageschema = wp_get_attachment_image_src(get_field('imagen'), 'thumbnail'); echo $imageschema[0]; ?>",
    Which does outputs the correct image url in the code source but unfortunately it doesn’t display the image in google results nor in in Google preview link test: https://search.google.com/test/rich-results

    Here’s an example
    https://search.google.com/test/rich-results?view=search-preview&id=X89aRoyDdZOWmVq73WvRhA

  • Try wp_get_attachment_image_url() instead. The function you’re using returns an array, not the URL.

  • Tried and this time Google returned an error in addition to not displaying the image.
    If you check here and click where it says “2 warnings” in orange you will see that the url of the image is correct (when using my original settings) so I’m puzzled.
    https://search.google.com/test/rich-results?id=aFTfkfEm_IJkVbMMTmUaMg

  • Those are warnings, not errors. They are because you’re not including “Offers” or “Performers.”
    This is for the Events scheme, and Google may or may not require those to be included for it to be valid (they may be optional).

    The image isn’t supposed to “Display” you’re just telling it what the URL is for the Event. If Google chooses to display this on Google (when someone does a search for Events), they can use the URL to show it at that point.

    In this case, it looks to be working properly.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.