Two Product entries on a Hyvä page. How do you tell JSON-LD from theme microdata?

2 min read

A terracotta lamp beside a frosted acrylic sheet and a paper product card

A Hyvä product page can contain Product both in an application/ld+json script and in an HTML element’s itemtype attribute. The Hyvä adapter in SEO Rich Data for Magento 2 1.0.38 removes microdata from supported fragments when Product is enabled. In the local trial, markup added in a separate block stayed in the HTML.

Save the source of the same product page before and after the change

In the test Hyvä Store View, go to Stores → Configuration → Kowal → SEO Rich Data. Enable Product and toggle Hyva Compatibility → Enable Hyva Compatibility. After each change, clean the configuration, layout, block, and full-page caches. Save the source of the same product page. Count Product and nested Offer objects in JSON-LD. In the HTML, look for itemscope and itemtype, and for itemprop around the price. Hyvä adapter documentation.

Identify which fragment produces the extra markup

The local trial ran the original adapter and JSON-LD renderer with a sample product and simulated Hyvä layout. Each cell gives the count of Product / Offer. The standard microdata came from body and product.info.price. The custom fragment was tested as a separate block and inside the HTML returned by product.info.

Markup counts in the test HTML
JSON-LDStandard microdataCustom microdata
1 / 1 · Adapter off1 / 10 / 0
1 / 1 · Adapter on0 / 00 / 0
1 / 1 · Separate custom block0 / 01 / 1
1 / 1 · Custom fragment inside product.info0 / 00 / 0
0 / 0 · Product section off1 / 10 / 0

Compare what you find with the page layout

A block outside the handled fragments can still output microdata. In the trial, the same HTML inside product.info went through the adapter and lost its schema attributes. If you still see two descriptions of the same product, locate the parent block in the layout and compare the SKU, price, and currency in both. Product structured data documentation.

For questions about how rich results appear, see the guide to JSON-LD and product stars.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)