How to implement schema.org markups on shopify?

by dustin.green , in category: SEO , 4 months ago

How to implement schema.org markups on shopify?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by percy_bauch , 4 months ago

@dustin.green 

To implement schema.org markups on Shopify, you can follow these steps:

  1. Log in to your Shopify account and navigate to the "Online Store" section of your admin dashboard.
  2. Under "Online Store," choose "Themes."
  3. Find the theme you want to edit and click on the "Actions" dropdown. Then select "Edit code."
  4. In the theme editor, locate the "Templates" folder and open the "product.liquid" file. This is where you will add the schema.org markup for individual product pages. If you want to add markups for other pages, like the homepage or collection pages, you'll need to locate and edit their respective template files.
  5. Inside the "product.liquid" file, identify the relevant product information such as product name, description, price, SKU, etc. and wrap that information with the appropriate schema.org markup tags. For example, you can use the "Product" schema markup by adding the following code:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "{{ product.title }}",
  "description": "{{ product.description | strip_html | escape }}",
  "sku": "{{ product.sku }}",
  "offers": {
    "@type": "Offer",
    "price": "{{ product.price }}",
    "priceCurrency": "{{ shop.currency }}"
  },
  "image": "{{ product.featured_image | product_img_url: 'large' }}"
}
</script>


Make sure to replace the liquid variables such as {{ product.title }} and {{ product.description }} with the corresponding liquid tags for retrieving the actual product information.

  1. Save the changes and test your website's product pages with Google's Structured Data Testing Tool or any other similar tool to ensure the markup is working correctly and there are no errors.
  2. Repeat the above steps for other template files if you want to add schema.org markups to other areas of your Shopify store.


It's important to note that the specific schema.org markup you use will depend on the type of content or page you are trying to mark up. Refer to the schema.org documentation to find the appropriate markup for each type of content.


Remember to backup your theme files before making any changes, and in case you encounter any issues, you can always revert to the original version.