Schema Markup: Nesting lots of elements, but i can't figure out the proper order to fit them

228 Views Asked by At

After testing, all elements I desire are currently in the following JSON. However, according to the schema markup tester, 'suborganization' and 'parentorganization' cannot be nested under 'webSite' Schema. Likewise, the SearchAction feature and 'inLanguage' also needs WebSite markup.

Theoretically I could start the schema with Organization and then identify 'WebSite' with each thing nested in the correct place. Anyone be able to quickly copy+paste things into the correct order to get it recognized? I've struggled to get everything recognized.

Info: ChevronWithTechron owns the brand ChevronExtramile. Then 'ExtaraMile Extras' is a sub-site of ChevronExtraMile

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebPage",
      "@id": "https://www.chevronextramile.com/",
      "url": "https://www.chevronextramile.com/",
      "name": "Chevron ExtraMile",
      "alternateName": "Chevron ExtraMile Convenience Stores, Rewards & Gas Stations",
      "isPartOf": {
        "@id": "https://www.chevronextramile.com/#website"
      },
      "primaryImageOfPage": {
        "@id": "https://www.chevronextramile.com/#primaryimage"
      },
      "image": {
        "@id": "https://www.chevronextramile.com/#primaryimage"
      },
      "thumbnailUrl": "https://www.chevronextramile.com/content/uploads/2021/05/extramile-storefront.jpg",
      "datePublished": "2021-01-15T05:53:47+00:00",
      "dateModified": "2023-02-31T15:57:32+00:00",
      "description": "Earn freebies with our huge selection of snacks, coffee, and food at your convenience. Or find information on stores, stations, and deals!",
      "breadcrumb": {
        "@id": "https://www.chevronextramile.com/#breadcrumb"
      },
      "inLanguage": "en-US",
      "potentialAction": [
        {
          "@type": "ReadAction",
          "target": [
            "https://www.chevronextramile.com/"
          ]
        }
      ]
    },
    {
      "@type": "ImageObject",
      "inLanguage": "en-US",
      "@id": "https://www.chevronextramile.com/#primaryimage",
      "url": "https://www.chevronextramile.com/content/uploads/2021/05/extramile-storefront.jpg",
      "contentUrl": "https://www.chevronextramile.com/content/uploads/2021/05/extramile-storefront.jpg",
      "width": 1280,
      "height": 853,
      "caption": "ExtraMile Storefront"
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://www.chevronextramile.com/#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home"
        }
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://www.chevronextramile.com/#website",
      "url": "https://www.chevronextramile.com/",
      "name": "ExtraMile",
      "description": "Look through our assortment of snacks, coffee, or food at your convenience. Get information on stores, stations, deals, rewards programs and more!",
      "sameAs": [
        "https://www.facebook.com/ExtraMileExtras",
        "https://www.instagram.com/chevronextramile/",
        "https://extramileextras.com/"
      ],
      "parentOrganization": {
        "@type": "Organization",
        "name": "Chevron with Techron",
        "url": "https://www.chevronwithtechron.com/",
        "logo": "https://www.chevronwithtechron.com/content/dam/external/chevron/en_us/marketing-support/web-images/chevron-with-techron/logo.svg"
      },
      "subOrganization": {
        "@type": "Organization",
        "name": "ExtraMile Extras",
        "url": "https://extramileextras.com/"
      },
      "potentialAction": [{
        "@type": "SearchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://www.chevronextramile.com/?s={search_term_string}"
        },
        "query-input": "required name=search_term_string"
      }],
      "inLanguage": "en-US"
    }
  ]
}
1

There are 1 best solutions below

4
Sean On

It's not validating because subOrganization and parentOrganization aren't properties of the WebSite schema. A website isn't an organization. But an organization can be the mainEntity of a website:

{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "My Company",
  "mainEntity": {
    "@type": "Organization",
    "name": "My Company, Inc.",
    "parentOrganization": ...,
    "subOrganization": ...
  }
}