NewsArticle not validing: "The attribute image.width has an invalid value."

5,024

See Google documentation: https://developers.google.com/search/docs/data-types/articles

Images should be at least 696 pixels wide.

So this one works for me:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "NewsArticle",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://google.com/article"
  },
  "headline": "Article headline",
  "image": {
    "@type": "ImageObject",
    "url": "https://google.com/thumbnail1.jpg",
    "width": 696,
    "height": 100
  },
  "datePublished": "2015-02-05T08:00:00+08:00",
  "dateModified": "2015-02-05T09:20:00+08:00",
  "author": {
    "@type": "Person",
    "name": "John Doe"
  },
   "publisher": {
    "@type": "Organization",
    "name": "Google",
    "logo": {
      "@type": "ImageObject",
      "url": "https://google.com/logo.jpg",
      "width": 10,
      "height": 60
    }
  },
  "description": "A most wonderful article"
}
</script>
Share:
5,024

Related videos on Youtube

Yen Deng
Author by

Yen Deng

Updated on September 18, 2022

Comments

  • Yen Deng
    Yen Deng over 1 year

    I'm using Google's template to mark up my blog and it seems that if I were to change the value of the width/height, it instantly tells me:

    The attribute image.width has an invalid value.

    The following is a template that Google has provided:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "NewsArticle",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://google.com/article"
      },
      "headline": "Article headline",
      "image": {
        "@type": "ImageObject",
        "url": "https://google.com/thumbnail1.jpg",
        "height": 800,
        "width": 800
      },
      "datePublished": "2015-02-05T08:00:00+08:00",
      "dateModified": "2015-02-05T09:20:00+08:00",
      "author": {
        "@type": "Person",
        "name": "John Doe"
      },
       "publisher": {
        "@type": "Organization",
        "name": "Google",
        "logo": {
          "@type": "ImageObject",
          "url": "https://google.com/logo.jpg",
          "width": 600,
          "height": 60
        }
      },
      "description": "A most wonderful article"
    }
    </script>
    

    The following source code is what I have changed:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "NewsArticle",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://google.com/article"
      },
      "headline": "Article headline",
      "image": {
        "@type": "ImageObject",
        "url": "https://google.com/thumbnail1.jpg",
        "height": 800,
        "width": **600**
      },
      "datePublished": "2015-02-05T08:00:00+08:00",
      "dateModified": "2015-02-05T09:20:00+08:00",
      "author": {
        "@type": "Person",
        "name": "John Doe"
      },
       "publisher": {
        "@type": "Organization",
        "name": "Google",
        "logo": {
          "@type": "ImageObject",
          "url": "https://google.com/logo.jpg",
          "width": 600,
          "height": 60
        }
      },
      "description": "A most wonderful article"
    }
    </script>
    

    Is is a bug from Google? Or am I just really lost?