• Resolved City Ranked Media

    (@cityranked)


    I am noticing a structured data error on the child pages of /product-category/ and /products/ –

    (The property “mainContentOfPage” is not recognized by Google for an object of type WebPage.)

    This appears to be untrue:
    https://schema.org/WebPage
    https://schema.org/mainContentOfPage

    – which is puzzling enough, but it’s also unclear from reviewing class-wp-structured-data.php how this schema is being constructed. For example, get_data_type_for_page() appears to generate schema types ‘website,’ ‘product,’ ‘review,’ ‘breadcrumblist,’ etc., but not ‘webpage.’

    Is this WebPage schema actually being generated by WooCommerce, or is it simply a coincidence (or conflict with another plugin) that is generating this error on the WooCommerce /product-category/ and /products/ child pages?

    If it is WooCommerce-generated, could anyone be so kind as to point us in the direction of the source code which generates this schema type, and a hook which we might use to customize/correct it?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter City Ranked Media

    (@cityranked)

    On closer scrutiny, this does appear to be a coincidence or interaction effect between the site’s theme and the WooCommerce pages.

    The nature of the error appears to be that the property mainContentOfPage is rendering as structured data with a superfluous set of quotation marks around it. Observe the attributes of the page’s theme-generated container div, which renders into:

    id=”theme-page” class=”master-holder clearfix” role=”"main"” itemprop=”"mainContentOfPage"”

    Phil

    (@fullysupportedphil)

    Automattic Happiness Engineer

    @cityranked does this happen when using the default Twenty Nineteen or Storefront themes? Or does it only happen when using your current theme?

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Structured Data Error on WooCommerce-generated pages’ is closed to new replies.