POORLY FORMATTED URL FOR SEO - SHOPIFY

Solved
New Member
2 0 1

Hi There!

 

I'd like to know if anybody could help me this issue please?

 

Below is the URL crawled by Google and obviously, it's poorly formatted.  

https://nyxshapewear.com/products/butt-lifter-panties?variant=24921424167012

 

We've done so much research to solve this problem by the way. 

We can't also block the ?variant=24921424167012 on robot.txt since shopify does not provide access for this if I'm not mistaken. 

 

So I come to a point and posted this issue if somebody would volunteer to help. 

 

I also deleted | within: collection code from the link below to make  sure that URL is readable and friendly for SEO. 

FROM

<a href="{{ product.url | within: collection }}" class="product-grid-image" data-collections-related="/collections/{{collection.handle}}?view=related">

TO
<a href="{{ product.url }}" class="product-grid-image" data-collections-related="/collections/{{collection.handle}}?view=related">

 

I was not able to figure out removing variant on URL; so that Google will no longer crawled this anymore. 

 

Thanks for your kind support.

 

Best regards,

 

0 Likes
Highlighted

Success.

Hi @James88 , 

 

It is possible to remove the ?variant=xxx from the URL. You would not be able to create links to variants then, only to products.

 

You can edit your product template -- find this code:

jQuery(function($) {
    new Shopify.OptionSelectors('productSelect', {
      product: {{ product | json }},
      onVariantSelected: selectCallback,
      enableHistoryState: true
    });

Make enable history state from true to false.

Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Free Review and advice for sale on store | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | SEO & Digital Marketing | Site Speed Optimization | Performance Site Audit
1 Like
Highlighted
New Member
4 0 0

Hi @oscprofessional ,

 

This is very informative. 

 

I was able to make it through your help only. 

 

But instead, I changed  ( enableHistoryState: false) instead of true. 

 

And the result was awesome (link provided below for your reference).

https://nyxshapewear.com/products/high-waist-mid-thigh-shaping-girdle

 

Thank you so much for your help, much appreciated.

 

Be blessed and keep helping for others. 

 

You inspired me as well to help them. 

 

Best regards,

0 Likes