SnipCart site: "$localize" showing up in Google search result snippet

83 Views Asked by At

I have customized my SnipCart e-commerce site following the customization documentation:

    <div hidden id="snipcart" data-api-key="MY_KEY">
        <address-fields>
            <div>
                <div class="snipcart-form__row">
                    <div class="snipcart-form__field snipcart-form__cell--large">
                        <snipcart-label class="snipcart__font--tiny" for="address1">
                            {{ $localize('address_form.address1') }}
                        </snipcart-label>

However, now I see $localize showing up in Google search results instead of the English text.

enter image description here

Google Search Console shows that the SnipCart .js resource (.css too) is blocked because of cdn.snipcart.com/robots.txt (which is configured to not allow crawling of anything). This seems to be the problem.

What is the proper way to fix this?

1

There are 1 best solutions below

0
On

Answering my own question in case someone else stumbles into this.

You can prevent certain content from showing up in the snippet with the data no-snippet directive, for example:

<span data-nosnippet>Don't show me</span>

Reference: https://developers.google.com/search/docs/advanced/crawling/special-tags#data-nosnippet