All things Shopify and commerce
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,
Solved! Go to the solution
This is an accepted solution.
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.
This is an accepted solution.
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.
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,
I am facing the same issue. The URL is https://www.eeplindia.com/Electromagnetic-Flow-Meters.html
Help required
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024