Mukul Jindal
Mukul Jindal

Reputation: 1

ListItem Schema [schema.org/ItemList] error: "All values provided for url must have the same domain."

I am facing issue with this ListItem schema validation on https://search.google.com/structured-data/testing-tool/u/0/ Getting error

All values provided for url must have the same domain.

I have provided same domain in every URL field.

{
    "@context": "http://schema.org",
    "@type": "ItemList",
    "name": "Tech News",
    "url": "http://m.gadgetsnow.com/tech-news",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": "1",
            "url": "http://m.gadgetsnow.com/tech-news/are-tvs-going-out-of-fashion/articleshow/58375579.cms",
            "name": "Are TVs going out of fashion?",
            "image": {
                "@type": "ImageObject",
                "contentUrl": "http://m.gadgetsnow.com/photo/58375579.cms",
                "width": "360",
                "height": "270",
                "url": "http://m.gadgetsnow.com/photo/58375579.cms"
            }
        },
        {
            "@type": "ListItem",
            "position": "2",
            "url": "http://m.gadgetsnow.com/tech-news/reliance-jio-discounts-are-not-going-anywhere-for-now-heres-why/articleshow/58374335.cms",
            "name": "Reliance Jio discounts are not going anywhere for now, here's why",
            "image": {
                "@type": "ImageObject",
                "contentUrl": "http://m.gadgetsnow.com/photo/58374335.cms",
                "width": "360",
                "height": "270",
                "url": "http://m.gadgetsnow.com/photo/58374335.cms"
            }
        }
    ]
}

Upvotes: 0

Views: 2385

Answers (2)

Stanislau Listratsenka
Stanislau Listratsenka

Reputation: 690

There are no bugs. Be careful if the validator gives errors, a big chance that rich snippets will not work.

So what's the problem? The first thing to note is that in the ListItem object, either url or item can be used. As the schema.org documentation says, item is used for:

an artist’s list of data artists (e.g. an 'artist' in a list of 'artists')

And the most important thing that I noticed: if you use item and you want the scheme to be correct, then the domain and its parts should be the same in all ListItem, but the anchors are different, which are separated from the url using the # symbol. Google gives a specific example:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ItemList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": "1",
      "item": {
        "@context": "https://schema.org/",
        "@type": "Recipe",
        "url": "http://example.com/big_list_of_recipes#cherry_pie",
      }
    },
    {
      "@type": "ListItem",
      "position": "2",
      "item": {
        "@context": "https://schema.org/",
        "@type": "Recipe",
        "url": "http://example.com/big_list_of_recipes#coffee_cake",
        ...
      }
    }
  ]
}
</script>

As you can see in the list, the same URL is used http://example.com/big_list_of_recipe, but different anchors: #cherry_pie and #coffee_cake. But still it is not clarity how to specify the URL, which is a separate page for the thing.

Upvotes: 0

abielita
abielita

Reputation: 13469

You may try using the correct version of ItemList. There are Separately and Combined marked up ItemLists as referred here.

  • If your items are on the same page, please use the version with items inside, the Combined one.
  • Otherwise, if you point to different pages inside and your items are not on one page, please DON’T put item element with type and other description inside, the Separately marked up one.

Additional references:

Upvotes: 1

Related Questions