user8380631
user8380631

Reputation:

Select DOM for mainContentOfPage with cssSelector: "The property value is not recognized by Google for an object of type WebPageElement."

I would like to integrate the structured data mainContentOfPage with the JSON-LD format.

I need to specify the part of the DOM, so I use the cssSelector property.

This is what the data looks like:

{
    "@context": "http://schema.org/",
    "@type": "WebPage",
    "mainContentOfPage": {
        "@type": "WebPageElement",
        "cssSelector": "#landingPage",
    },
}

The structured data test tool gives me a warning:

The property value is not recognized by Google for an object of type WebPageElement.

How can I do this?

You can test this code in the SDTT:

<html lang="fr">
  <head>
    <meta charset="UTF-8">
    <script type="application/ld+json">
    {"@context":"http://schema.org/","@type":"WebPage","mainContentOfPage":{"@type":"WebPageElement","cssSelector":"#landingPage"}}
    </script>
  </head>
  <body>
    <div id="landingPage">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In non molestie libero.</div>
  </body>
</html>

Upvotes: 3

Views: 801

Answers (1)

grg
grg

Reputation: 5874

cssSelector is not part of schema.org core yet. You can't use it as part of schema.org yet, only when it's moved from pending to core.

The term 'cssSelector' is not in the schema.org core vocabulary, but is defined in an extension:

  • pending: cssSelector

https://schema.org/cssSelector

Upvotes: 0

Related Questions