Magento 2 Google Rich Snippets

Installation and User Guide for Magento 2 Rich Snippets for Google, Microsoft and Yahoo

Table of Contents

  1. Installation
    • Installation via app/code
    • Installation via Composer
  2. Configuration Settings for SEO Base
    • General Settings
  3. Configuration Settings for Rich Snippets
    • General Settings
    • Rich Snippets General Settings
    • Twitter Card Settings
    • Facebook Open Graph Settings
    • Pinterest Rich Pins Settings
    • Free Shipping (Website Level)
    • Price Valid Until
  4. Structured Data / Markup Code of Front-end Page(s) in Structured Data Testing Tool
    • Home Page Markup Code
    • Category Page Markup Code
    • Product Page Markup Code
    • Twitter, Facebook Open Graph Social Sharing Code
    • Increased and Optimized Page Ranking in Search Results
  5. Set Primary Categories

Installation

https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer

Configuration Settings for SEO Base

Go to Admin > Stores > Configuration > Scommerce Configuration > SEO Base

General Settings

image.png

Configuration Settings for Rich Snippets

Go to Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet

General Settings

image (1).png

Rich Snippets General Settings

image (2).png

Twitter Card Settings

image (3).png

Facebook Open Graph Settings 

image (4).png

Pinterest Rich Pins Settings

image (5).png

Free Shipping(Website Level)

Some settings are only available on the website level for eg:- Region/State.

image (6).png

Price Valid Until

Send Price valid until with the offers markup code for products.

image (7).png

Structured Data / Markup Code of Front-end Page(s) in Structured Data Testing Tool

image.jpg

image (1).jpg

image (8).png

Shipping Markup Code - To add structured data markup code on product page, set "Enable" to "Yes" from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet.

image (9).png

Price Valid Until - To add the price valid until date with the structured data markup code on the product page, Set the "Start Month" and the "Time Interval" from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet > Price Valid Until.

image (10).png

Twitter, Facebook Open Graph Social Sharing Code

image (2).jpg

image (3).jpg

image (4).jpg

Set Primary Categories

You can use a script provided with the extension to automatically add primary categories for products. Admin can exclude certain categories from primary category and also prioritise one category over the other to be picked as the primary category.

Go to Admin>Catalog>Categories select a category then scroll down to find the option "Primary Category Settings". Here click on "Exclude From Primary Category" to exclude this category from primary category or enter the priority 0 being the highes. The highest priority category will be picked first for the primary category.

image (11).png

To automatically assingn primary category for all products run the command given below by going into the root directory of your store. 

scommerce:seo-base:set-primary-category

N.B - If you are using older version then run the script provided in the extension folder at the path Data/SetPrimaryCategoryM2.php from ssh

If you have a question related to this extension please check out our FAQ section first. If you can't find the answer you are looking for then please contact support@scommerce-mage.com.


Revision #6
Created 2 May 2025 12:45:15 by scommerce
Updated 24 October 2025 09:34:10 by scommerce