Solved

Shopify JSON-LD - how to modify the description to use product meta

mfcss
Explorer
65 6 28

I'm looking to use Shopify's built-in JSON-LD functionality for product schema markup.

However, I have one issue: My product pages are a bit non-traditional as they use extensive descriptions, pictures and advanced HTML (we sell B2B). As a result, the default "description" becomes very messy and long when using the below default method from the product.liquid file:

 

"description": {{ product.description | strip_html | json }}

 

Ideally I would like to replace the product.description with e.g. my SEO meta description from each page - but I seem to be unable to identify the adequate handle to parse in order to achieve this. Is there a way to successfully do this?

If not, is there a way to define the description separately on each page - i.e. could I remove the description field from the Shopify-generated schema information - and then parse a separate block containing only this on each product page?

Accepted Solution (1)

mfcss
Explorer
65 6 28

This is an accepted solution.

It seems using below solved this for me:

 

"description": {{page_description}},

View solution in original post

Replies 2 (2)

eComInsider
Shopify Partner
154 16 36

use this theme for long description 🙂

https://themes.shopify.com/themes/warehouse/styles/metal/preview

 

➡️ Exclusive offer - Shopify Trial at $1/month


➡️ Shopify Blogs (Q&A)

➡️ Your;Coffee Tip: my code = a perfect blend!

mfcss
Explorer
65 6 28

This is an accepted solution.

It seems using below solved this for me:

 

"description": {{page_description}},