Metafields. Schema Markup

Metafields. Schema Markup

Sveta_Developer
Shopify Partner
1 0 0

I'm attempting to dynamically generate FAQ and How-to schema markup using meta fields within my Shopify article template (main.article.liquid). I've verified that the schema snippets themselves are valid using schema.org's validator, showing no errors. However, when I test the complete article page with Google's Rich Results Test or schema.org's validator, the schema is not recognized. This leads me to believe there's an issue with how the meta fields are being implemented or integrated within the main.article.liquid code. What are the common pitfalls that could prevent the schema from being detected in this scenario, and how can I troubleshoot them? Thank you for your help.

Reply 1 (1)

Yuparkoti
Shopify Partner
209 14 24

@Sveta_Developer 

There could be —

Common Pitfalls
Problems with JSON-LD Syntax: The presence of unescaped characters in JSON may disrupt liquid.
Positioning: The schema is to be placed within <script type="application/ld+json"> either in the <head> or <body> section.
Liquid Issues: Syntax errors or improper integration could prevent metafields from appearing.
Conflicts: Similar tags within one document will lead validators astray.
Missing Tags: Invalid or absent <script> attributes.
Caching: Shopify rendering does not fully process dynamic schema.
Troubleshooting
Check HTML: View source, ensure valid JSON-LD, no Liquid leftovers.
Verify Metafields: Check settings & content at admin panel of Shopify.
Test Static: Make it simple - put some hardcoded schema and check if everything is fine with Google Rich Results Test.
Simplify: Lessen the complexity of your fluid then start increasing it gradually again.
Avoid JS Issues: To avoid any problem with JavaScript turn it off or take advantage of Google URL inspection tool.
Fix Validator Warnings: Correct any mistakes that give rise to validator warnings.

— Solve it? Hit Like and Accept Solution!
➡️Enjoy—Shopify 3 Day Free Trial | $1/Month for 3 Month
➡️Get Started—Shopify Point of Sale