04-10-2023, 06:29 AM
To add Product Schema code to your Shopify website, follow these steps:
Log in to your Shopify account and go to the "Online Store" section.
Click on "Themes" and then select "Actions" and "Edit Code" on the theme that you want to add the schema code to.
Open the "product-template.liquid" file.
Scroll down to the bottom of the file and locate the </body> tag.
Just before the </body> tag, paste the following code:
json
Copy code
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "{{ product.title }}",
"image": "{{ product.featured_image | img_url: '600x600' }}",
"description": "{{ product.description | strip_html | escape }}",
"sku": "{{ product.sku }}",
"brand": {
"@type": "Brand",
"name": "{{ product.vendor }}"
},
"offers": {
"@type": "Offer",
"price": "{{ product.price }}",
"priceCurrency": "{{ shop.currency }}"
}
}
</script>
Save the changes and preview the product page to ensure that the schema code is displaying correctly.
Note: Make sure to replace the liquid variables in the code with the appropriate variable names used in your Shopify store. Also, note that this code only covers the basic product schema, and additional schema properties can be added as per your requirement.
Log in to your Shopify account and go to the "Online Store" section.
Click on "Themes" and then select "Actions" and "Edit Code" on the theme that you want to add the schema code to.
Open the "product-template.liquid" file.
Scroll down to the bottom of the file and locate the </body> tag.
Just before the </body> tag, paste the following code:
json
Copy code
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "{{ product.title }}",
"image": "{{ product.featured_image | img_url: '600x600' }}",
"description": "{{ product.description | strip_html | escape }}",
"sku": "{{ product.sku }}",
"brand": {
"@type": "Brand",
"name": "{{ product.vendor }}"
},
"offers": {
"@type": "Offer",
"price": "{{ product.price }}",
"priceCurrency": "{{ shop.currency }}"
}
}
</script>
Save the changes and preview the product page to ensure that the schema code is displaying correctly.
Note: Make sure to replace the liquid variables in the code with the appropriate variable names used in your Shopify store. Also, note that this code only covers the basic product schema, and additional schema properties can be added as per your requirement.
eUKHost : Managed Web Hosting Provider
cPanel Web Hosting | Linux VPS Hosting | Secure Cloud Server Hosting
cPanel Web Hosting | Linux VPS Hosting | Secure Cloud Server Hosting