Skip to content

Instantly share code, notes, and snippets.

@gmmedia
Created August 24, 2025 13:42
Show Gist options
  • Save gmmedia/1753b61b89a4e889951a1261e00ff7ca to your computer and use it in GitHub Desktop.
Save gmmedia/1753b61b89a4e889951a1261e00ff7ca to your computer and use it in GitHub Desktop.
Shopify jsonld for Collections
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CollectionPage",
"name": {{ collection.title | json }},
"url": "{{ shop.url }}{{ collection.url }}",
"description": {{ collection.description | strip_html | truncate: 300 | json }},
"mainEntity": {
"@type": "ItemList",
"name": {{ collection.title | json }},
"itemListOrder": "https://schema.org/ItemListOrderDescending",
"numberOfItems": {{ collection.products_count }},
"itemListElement": [
{% for product in collection.products limit: 20 %}
{
"@type": "Product",
"name": {{ product.title | json }},
"url": "{{ shop.url }}{{ product.url }}",
"image": {{ product.featured_image | img_url: '800x800' | prepend: 'https:' | json }},
"offers": {
"@type": "Offer",
"priceCurrency": "{{ cart.currency.iso_code }}",
"price": "{{ product.price | divided_by: 100.0 }}",
"availability": "https://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}"
}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
},
"publisher": {
"@type": "Organization",
"name": {{ shop.name | json }},
"url": "{{ shop.url }}",
"logo": {
"@type": "ImageObject",
"url": "{{ shop.brand.logo | img_url: '200x200' | prepend: 'https:' }}"
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment