question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google AMP: Invalid structured data element

See original GitHub issue

Issue Summary

After Google started to index my blog ( https://blog.julianxhokaxhiu.com ), AMP results stated that there are two errors in the AMP markup. First let me show an example:

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "A Developer&#x27;s Blog",
        "logo": "http://blog.julianxhokaxhiu.com/content/images/2016/04/8bitme.png"
    },
    "author": {
        "@type": "Person",
        "name": "Julian Xhokaxhiu",
        "image": {
            "@type": "ImageObject",
            "url": "//www.gravatar.com/avatar/b5617bc9e7be91f93110e323d2f70e09?s=250&d=mm&r=x",
            "width": 250,
            "height": 250
        },
        "url": "http://blog.julianxhokaxhiu.com/author/julian/",
        "sameAs": []
    },
    "headline": "How to setup an SSH server on ZyXEL NSA320",
    "url": "https://blog.julianxhokaxhiu.com/how-to-setup-an-ssh-server-on-zyxel-nsa320/",
    "datePublished": "2013-06-29T16:45:03.000Z",
    "dateModified": "2013-06-29T16:45:03.000Z",
    "keywords": "Modding",
    "description": "Hi there, some days ago I bought a very kind NAS for myself after the (terrible) adventure with WD My Book World Edition II. Not that it was so bad but...after three years it was very old (Kernel 2.6.24) and not so much apps were supported nowadays.",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "http://blog.julianxhokaxhiu.com"
    }
}
    </script>

The first error detected is:

  • The attribute logo.itemtype has an invalid value. As you see publisher.logo should be a Dictionary with @type entry, but currently is just a string ( URL path ).
  • A value for the image field is required. As you see there is no image entry in the root of the Dictionary.

Is it possible to fix them autonomously? Even better, can you streamline the fix?

Thank you in advance!

Steps to Reproduce

  1. Click https://search.google.com/structured-data/testing-tool?url=http%3A%2F%2Fblog.julianxhokaxhiu.com%2Fhow-to-setup-an-ssh-server-on-zyxel-nsa320%2Famp%2F#url=http%3A%2F%2Fblog.julianxhokaxhiu.com%2Fhow-to-setup-an-ssh-server-on-zyxel-nsa320%2Famp%2F
  2. See the output on the right

Currently: two errors appears.

Expected: no errors.

Technical details:

  • Ghost Version: 0.11 ( lastest Docker image https://hub.docker.com/_/ghost/ )
  • Node Version: The one inside the Docker
  • Browser/OS: Doesn’t matter.
  • Database: The one inside the Docker

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aileencommented, Sep 19, 2016

Hey @julianxhokaxhiu, this is not an issue with AMP in particular. The same errors will be shown for a regular blog post in Google’s structured data testing tool.

The attribute logo.itemtype has an invalid value. As you see publisher.logo should be a Dictionary with @type entry, but currently is just a string ( URL path )

This is a warning and it results from a blog logo. Ghost will output a 100% valid ImageObject for publisher.logo, as soon as you provide a logo, which fits the requirements (< 60px height and <600px width). This is a workaround for now, until we implement full image handling in Ghost.

A value for the image field is required. As you see there is no image entry in the root of the Dictionary

Google wants a blog picture lately. As soon, as you add an image to your blog post, this error will be gone. I know, this is not perfect, but that’s what Google wants obviously. And as I said, the same error and warning will be show for your regular blog post.

We will close this issue for now. If you need any further assistance in optimising your JSON-LD data, please feel free to pass by in our slack help channel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AMP > Error in required structured data element - WordPress.org
It says some “Missing or invalid structured data item”. Untitled-1. Although It's strange that “AMP validator” and “Google structure data testing tools” are ......
Read more >
Error in required structured data element This is a non-critical ...
This is a non-critical issue. AMP pages with these issues are valid, but are either: missing advanced AMP features, not using best practices ......
Read more >
Solved: "Error in required structured data element" (AMP issue)
AMP version has invalid structured data. An AMP issue ... An AMP issue in Google Search Console: “Error in required structured data element”....
Read more >
How to Fix Missing or Invalid Structured Data Item on AMP ...
Once you upload the site icon image, go back to validate your page using Google's Structured Data Testing Tool and the error should...
Read more >
Is Google AMP biased towards a set of use cases? - WebKJ
Fix the structured data element in your page. AMP pages with an invalid required structured data element may appear in Google Search results...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found