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
I'm poor i need mony
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025