Shopify Adding Junk Code to Schema.org Markup

Highlighted
Tourist
16 0 2

I was trying to add schema.org markup for our "contact us" page. But Shopify is adding extra characters to the original code.

The right code should be:
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
Shopify converts it to:
<div itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress">

There's an extra [=""] to itemscope

It also stripped out the <link itemprop="sameAs"> lines and the <span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> declaration.

I used the HTML editor.

Hope someone who has experienced this can provide a fix.

0 Likes
Highlighted
Shopify Expert
240 0 38

This is a common issue with html editors.

The extra ="" should be no issue,but removing itemprops is.

This would be something Shopify would have to fix.

You may be able to add your details using json-ld instead of microformat. That is data placed in a <script> tag which may not get removed.

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
Highlighted
Tourist
16 0 2

Thanks for the advice, Tony. I'm not familiar with json-ld, so need to do some research to implement it.

0 Likes
Highlighted
Shopify Expert
240 0 38

Googles documentation for LocalBusiness markup (come to a search engine near you soon) provides a good example of the markup you can use, and Google wants. Just replace the details with what matches your business, then add it to the page and test it with the Google Structured Data Testing Tool:

https://developers.google.com/search/docs/data-types/local-businesses

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
Highlighted
Tourist
16 0 2

The Google Structured Data Testing Tool is a great place to verify the markup before going live.

My theme developer suggested using the markup directly in the liquid which won't result in nasty renderings. It worked out well.

I checked json-ld ou as well. It looks pretty straight forward.

0 Likes
Highlighted
Shopify Expert
240 0 38

The markup itself is not visible, but it should represent content that is.

Not long ago, microdata markup using meta tags was against the rules. At this time it seems it is ok, but the content it includes has to be visible some where else on the page. I still recomend marking up the visible content (or use json-ld) to remove ambiguity and the risk that Google decides it is deceptive markup.

 

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
Highlighted
New Member
2 0 0

I also experienced similar things. I am confused. hoping someone would help me.  :(

Hidup Lebih Baik
0 Likes
Highlighted
New Member
2 0 0

I also experienced similar things. I am confused. hoping someone would help me.

Hidup Lebih Baik
0 Likes
Highlighted
Tourist
16 0 2

That's a good point, Tony. Google has a pretty tough stance on hidden content. But since Google is part of the schema.org initiative, I believe it is OK to use the markup if the content is visible somewhere on the page.

0 Likes
Highlighted
Shopify Expert
240 0 38

schema.org just defines a data structure (schema) on how to define your information. They don't care how you do it.

It's the data readers like Google that read it and need to decide how trustworthy it is. I personally believe they will have a sliding scale, like a percentage, of trust. 

Visibility is a core quality/trust signal for Google:

Markup should not be used to hide content not visible to users in any form, since it might create a misleading or deceptive search experience. For example, if the JSON-LD markup describes a performer, the HTML body should describe that same performer.

https://developers.google.com/search/docs/guides/intro-structured-data

But they have more, that they don't tell us about.

I beleive its always a good move to try and help search engines as much as possible. For them to determine that meta data content is also in the visible content is hard, and why they did not support it before. So best to mark up the visible content and automatically have that box ticked.

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes