4

enter image description here

I have installed an extension which puts Rich Cards on my product pages, however the default Magento structured data code for rich snippets is still present. How can I remove this from product pages?

7

This helps me to remove Magento default product schema by following steps.

1. Remove product schema from body. Add this to catalog_product_view.xml under your theme.

<body>
    <attribute name="itemtype" remove="true"/>
    <attribute name="itemscope" remove="true"/>
</body>

2. Remove aggregateRating

Copy this to your theme

vendor/magento/module-review/view/frontend/templates/helper/summary.phtml

remove

itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"

3. Remove Review

Copy this to your theme

vendor/magento/module-review/view/frontend/templates/product/view/list.phtml

Remove

itemscope itemprop="review" itemtype="http://schema.org/Review"

Note: missing #2 and #3 will receive an error similar to below in validation due to action #1

“The review has no reviewed item specified.”
0

When I added remove='true' to these attributes - I got the following error:

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'attribute', attribute 'remove': The attribute 'remove' is not allowed.

To get these properties to disappear, I changed them to this instead:

<attribute name="itemtype" value="" />
<attribute name="itemscope" value="" />

Reference for the Solution:

https://github.com/magento/magento2/issues/10889

New contributor
breakworm is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.