Hiding the Default Rich Snippets Functionality in Magento 2

If you’ve come to this page, you must know what Rich Snippets are and how they work in Magento 2.

Upon the whole, the structured data markup is quite a cool feature of the second version of the eCommerce platform. Schema.org was added as the default template, which lets merchants equip their site search results with price, rating, reviews or other markup values in just a few-clicks.

There are, however, some cases when you may want to disable the default rich snippets functionality. The reasons for that can be:

price format issues — currently, the format used by Magento 2 doesn’t correspond to the latest schema.Org requirements, which may trigger the following error:

conflicts with some 3-d party structured data markup extensions,

issues with Google products — this type of products may come with a different price (e.g. MSRP), which, in turn, triggers conflicts with the default Magento 2 rich snippets.

Unfortunately, up to v.2.1.1, it’s impossible to disable the default rich snippets functionality via the Config settings. Hence, you need some workaround solution.

In this article, I’ll tell you how to disable the default structured data markup via creating a a little, yet very useful extension for Magento 2.

First, let’s create the extension’s environment.

Creating the Extension

Let’s call it ‘Owner_Custom’ (although, you can choose any name you wish).

Next, go to app/code and create an ‘Owner’ folder there. Inside of this folder, create a new one, named ‘Custom’ — it will be the root folder for our extension.

By adding these piece, we’ve removed the parameter that was responsible for marking up this block as an ‘Offer’. As a result, Google tools don’t detect any data that could be used for Rich Snippets here:

And there is one final touch left to do.

In order to disable the default rich snippets for all product types, you need to add 2 more files. This one for downloadable products: