Why is this additional string appearing in my product URL and how can I remove it?

Karen14
Excursionist
15 0 4

I am used to seeing additional strings on our product URLs when the product is out of stock - or for some reason, a duplicate product page was made, but I have never seen this one - ?_pos=2&_sid=0ce38240f&_ss=r.  Does anyone know why this is appearing and how to get rid of it? Thank you.

Replies 25 (25)

Elle
Shopify Staff
1092 97 208

Hi, @Karen14 


Elle here from Shopify!

 

I'm not sure why the string would be appearing but happy to look into this for you! If you can provide more details it will be very helpful. 


* What path are you taking to get to these URLs? (Does the string appear when simply going to your store and selecting a product?)

 

* Have you noticed any trends? Do only certain products display this string? 


* Can you provide some example URLs?

 

Thanks so much and looking forward to hearing from you!

 

Cheers,
Elle

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Karen14
Excursionist
15 0 4

Hi Elle - yes there is a trend and it is something I just noticed last week with one product URL and I was able (unknowingly) to duplicate it a couple of minutes ago. If you are going through the website and click on a product the URL appears properly, but if you do a search for the product and click on any product that is appearing the string is added to the URL. So the position of the product appears in the string - ?_pos=3. I have tried this numerous times (I am doing some redirects and when searching for the products I want I was able to see this). Nothing has been changed on the backend of the website as far as I know - and I have not seen this before (and I do a number of redirects weekly and search to find the correct product & URL).

URL - https://www.canuckhomebrewsupply.com/products/flav-extract-peanut-butter

If you do a search for 'Peanut Butter' and then click on the product the URL is - https://www.canuckhomebrewsupply.com/products/flav-extract-peanut-butter?_pos=2&_sid=0ce38240f&_ss=r

 

URL - https://www.canuckhomebrewsupply.com/products/cp-tap-handle-finial

If you do a search for 'Finial' and then click on the product the URL is - https://www.canuckhomebrewsupply.com/products/cp-tap-handle-finial?_pos=3&_sid=2f334c4b9&_ss=r

 

Thanks for your assistance.

Elle
Shopify Staff
1092 97 208

Thank you for the additional context! 

 

The 'pos' part of the string is referring to the position the product appears in based on the search criteria. 

For example: When you search 'peanut butter', three products appear. The first one will display pos 1 in the string since it was displayed first, the second one will display pos 2 in the string since it is displayed second, so on and so forth. 

 

15-13-20808-m208u


This is expected behaviour across all stores and I do not believe there is a way to remove this from the URL. May I ask why you wish to remove it from the URL? Is this negatively impacting your store somehow? Please let me know!


Thanks so much,

Elle

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Karen14
Excursionist
15 0 4
Hi Elle - Yes I knew why it was happening as I was able to duplicate it,
but I must say that this only started to happen Thurs. July 11, 2019. Never
before has the URL appeared this way when doing a search and then clicking
on the product. You or your tech team might ask 'How can she be sure that
is always hasn't been this way.' The reason I know it only started recently
is that when I do URL redirects I always search for the product, click on
it and then copy the entire URL after the /, and place it in the 'Redirect
to' box. I never have to remove any other part of the URL unless the
redirect is going to a product that is currently out of stock - then I have
to remove the ?variant=.

I may not be your typical Shopify user as I work in-house and I am able to
dedicate much of my work week to our website, so I would normally spend
about 20 hours a week editing, updating and adding new products. Spending
so much time on one website and recording what and where I do things makes
it easy for me to know what page, what I was doing and the date that I was
doing it.

To say it is negatively impacting our store, at this time I would say no
(however if the Googlebot happened to hit our store while the page with the
unusual URL string was open, then yes it could have a negative impact).

My biggest reason for wanting to get rid of the extra string in the URL is
for editing purposes. While it may not seem like a big deal to take an
extra second or two to grab a clean URL, when editing, redirecting and
checking stock the few extra seconds add up, and I hate wasting time. I see
absolutely no reason for the search position to be inserted into the URL,
it has no positive impact what so ever.

Thanks again - Karen
PaulNewton
Shopify Partner
6275 574 1324

 

 


@Karen14 wrote:
My biggest reason for wanting to get rid of the extra string in the URL is
for editing purposes. While it may not seem like a big deal to take an
extra second or two to grab a clean URL, when editing, redirecting and
checking stock the few extra seconds add up, and I hate wasting time.

Could you elaborate on this workflow and the why of frequent redirects?

to clarify are you searching for products in the admin or the frontend?

If your changing product handles redirects should be created automatically

If your using the frontend to make decisions about data|actions in the admin consider making a utility theme or templates to facilitate this workflow if apps are out of the question.

 

(however if the Googlebot happened to hit our store while the page with the
unusual URL string was open, then yes it could have a negative impact).

Such pages|urls shouldn't be indexed in properly setup themes

 


I see absolutely no reason for the search position to be inserted into the URL,
it has no positive impact what so ever.


Analytics yours or shopifys, and apps, and browser extensions.

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Karen14
Excursionist
15 0 4

Could you elaborate on this workflow and the why of frequent redirects?

-the reason for frequent redirects is that some products are discontinued, and in order to keep a good UX I always redirect the page to an appropriate page. I also keep a good eye on the Google Search Console and fix any 404s. As you are probably aware, Google keeps things in their index almost indefinitely. They are still finding URLs from previous CMS, so those old URLs need to be redirected to the proper pages.

 

To clarify are you searching for products in the admin or the frontend?

- I am searching for products from the front end. We sell numerous products that are similar to each other, so being able to look at the products that are on the website makes it easier to make sure that product pages we are redirecting go to the correct page.

 

I find that the additional string being added to the URL is not needed. We also use the search feature to find products for our customers when they are unsure of what they may need for their setup. We only want to send them the URL for the product, not a URL that contains where it was found on a search page.

PaulNewton
Shopify Partner
6275 574 1324

@Karen14 wrote:

Could you elaborate on this workflow and the why of frequent redirects?

-the reason for frequent redirects is that some products are discontinued, and in order to keep a good UX I always redirect the page to an appropriate page.


For future readers, if doing this make sure to check for backlinks for extra context when deciding where to redirect, 

and either:

A) avoid redirecting to other products that may themselves end up discontinued and have MORE redirects

B) methodically check redirects to avoid discontinued redirect chains that will build up over time.

 

 


@Karen14 wrote:

To clarify are you searching for products in the admin or the frontend?

 

I find that the additional string being added to the URL is not needed. We also use the search feature to find products for our customers when they are unsure of what they may need for their setup. We only want to send them the URL for the product, not a URL that contains where it was found on a search page.


If your doing work often using the front end you probably start wanting to build theme utilities for yourself that only show with a specific logged in customer or a separate theme used in preview mode.

 

Like making the 1 click button to copy only the url handle to your clipboard,

https://clipboardjs.com/ for clipboard shenaingans

Or generate the admin redirect https://help.shopify.com/en/api/reference/online-store/redirect#create-2019-04

Example using jquery

<button onclick='jQuery.post("/admin/api/2019-04/redirects.json","redirect%5Bpath%5D=%2Fproducts%2Fproduct1&redirect%5Btarget%5D=%2Fproducts%2Fproduct2")' />

 etc etc

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Elle
Shopify Staff
1092 97 208

Hi, @Karen14 !

 

I can certainly appreciate how this is impacting your day to day workflow. 

@Georgi_Demirev, thank you for letting me know how this change has affected your store. Is the code within your theme something you added or was this built into the theme? 

 

I will be bringing all of these details back to our developers for consideration and I will share any updates I receive here! 

 

Cheers,
Elle

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Karen14
Excursionist
15 0 4

Thanks Elle for passing this info on to your Developers. While yes it does impact my day to day work, I think one of my biggest peeves would be that something was changed and Shopify customers were not notified of the change. I spent time trying to troubleshoot what the issue might be and then stumbled upon why it was happening when doing a search for a different product and clicking on it. Curious to know how many others that look after a Shopify store saw that the URL had an additional string and may have spent both time and money trying to get it corrected (when they do not have an in-house web person) when there was nothing they could do because Shopify changed the backend without telling anyone. 

Elle
Shopify Staff
1092 97 208

I absolutely understand where you're coming from @Karen14 ! Your feedback is extremely valuable and ultimately helps us improve our platform. It looks like our Changelog was updated today to note the update here.

 

Also, please reach out to our support whenever you have an issue you need assistance with! We're available 24/7 and happy to help!

 

@Georgi_Demirev, thanks for providing that context! If you're unhappy with the theme you're currently using, I'd be more than happy to help recommend an alternate theme based on the features you're looking for. Just let me know. 

 

Cheers,

Elle

 

 

 

 

 

 

 

 

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Elle
Shopify Staff
1092 97 208

Hi, all

 

A quick update about the change to our search parameters. 

This update will allow us to improve search functionality in the longterm and at this time it is a permanent change. 

 

Your feedback has been logged with our developers and is always appreciated. 

 

If you have any other questions don't hesitate to get in touch with our support, we're available 24/7.

 

Best,

Elle

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Karen14
Excursionist
15 0 4

Good morning Elle - while "This update will allow us to improve search functionality in the longterm and at this time it is a permanent change. " - that statement would appear to me that your dev. are testing and gathering information on how the search feature works, this is being done on live websites that are being paid for by your customers. I would think that if they want to test a feature it should be made perfectly clear to your paying customers that it is being done, prior to doing so, and that they should have the option of opting out of the tests and research.  Of course, that is just my opinion.

 

Thanks for the update.

Bijouxmedusa
Visitor
2 0 6
I notified too that change was made to Url into the search.

At first I thought something on my side did this or a plugin.

In fact that really annoying, we share URL to Customers all the time, via email, facebook, instagram or live chat.

I like to copy past clean URL, that do not look professional when you have big strange/weird url. Customers feels confortable when it's flawless.

You say that a perma change, but some store do not have this. I check many Website to know If problem was affecting other store.

Fashionnova.com still have no url string added when searching on they Website.

Look like you didnt changed this for your big Customers. Of course you can't do that to store like fashionnova. Using only small store to test this feature...

Really
Julien Duguay
Medusa | Owner
bijouxmedusa.com
Karen14
Excursionist
15 0 4

I totally agree with you. Curious to know as well, as the products change position on a page, so would the 'position' of a product on the search. So... if you were to send the total URL with the additional string to a customer, would they see a different product(should another product now occupy that position)? 

I think Shopify needs to rethink this new 'search feature' as it is not in any way useful to the average website user or whoever owns and updates the website.

timd_mackey
Shopify Partner
61 1 32

This change breaks any liquid code that uses ?view= urls to point to a specific product template view.

We ran into this issue because our lightboxes use these kind of links, and the links were invalidated by having multiple question marks in them after this change. Our lightboxes all stopped working without any explanation, and it was quite a puzzle figuring out what had happened.

What before was as easy as:

{{ current_product.url | within: collection }}?view=quickview

now needs logic to make sure that the link doesn't break:

{% assign product_url = current_product.url | within: collection %}
{{ product_url }}{% if product_url contains '?' %}&amp;{% else %}?{% endif %}view=quickview

We need to be able to trust that things we rely on in Shopify code aren't going to break without warning. Do I need to change all of my view links to use this logic just in case a decision like this is made again in the future?

 

This change may be for the better, and it may enable useful features in the future, but we should have been warned in advance. I'm sure there are other stores out there that are having issues because of this change, and they're probably just as confused as I am as to what the cause is (that is, if they're even aware of the problem)

 

Marlon_Creative
Visitor
2 0 1

This seems to work OK (just had to do it on a store that uses an ajax quickview, which was breaking on the search results page because of the additional url strings). Change the following:

<a href="{{product.url}}"

to this:

{% assign newproducturl = product.url | split: '?' %}
<a href="{{newproducturl[0]}}"

So you're basically exploding the url at the "?" and returning just the first part of the array (still also works on the normal collection urls).

Karen14
Excursionist
15 0 4

Thank you for sharing your fix with us. Could you please tell me where it was in the backend that you changed the code? We are using the liquid theme and I think I have looked everywhere to see if I could find the <a href="{{product.url}}". The closest I have been able to find is {{item.url}}. I am not close to being an expert using Shopify - the backend coding was dumped on me when the person looking after that part of the website left. Thanks again - Karen.

Marlon_Creative
Visitor
2 0 1

Hi Karen. It's quite possible it could be different for your theme, but for the one I was working on, it was in the following location:

 

/snippets/collection__thumb.liquid
Singhui
Tourist
4 0 3

Hi guys,

 

Thanks. I have a similar problem with my shopify store too - https://www.hellocircus.com/products/big-summer-diamond-wallpaper?_pos=2&_psq=big%20dia&_ss=e&_v=1.0

 

I am a small business owner and is doing everything by myself, so I am not an expert in web design. We sell wallpapers online which requires customers to provide me with the dimensions of their walls. I will respond based on the weblink. Hence, it will be easier if we can remove the extra words behind the URL to prevent any potential mix-ups

 

I am using the theme Symmetry and could not find 

/snippets/collection__thumb.liquid

How do you find an alternative for this?

 

Thank you for all your help.

 

Warmest regards,

timd_mackey
Shopify Partner
61 1 32

@Singhui I wrote this little javascript function to remove these url parameters from your product page. This will leave the urls as is on the search page (in case Shopify does use the information for something), but will clean up the url when the product page is loaded.

 

Screen Shot 2020-05-17 at 1.56.10 PM.png

 Code:

 

<script>
(function () {
  var keys = ['_pos','_sid','_ss'];
  var deleteRegex = new RegExp(keys.join('=|') + '=')

  var params = location.search.slice(1).split('&')
  var search = []
  for (var i = 0; i < params.length; i++) if (deleteRegex.test(params[i]) === false) search.push(params[i])

  window.history.replaceState({}, document.title, location.pathname + (search.length ? '?' + search.join('&') : '') + location.hash)
})();
</script>

 

Add this code at the bottom of your templates/product.liquid theme file.

DeeDee123
Shopify Partner
1 0 0

Hi, we have added this to where you said to put it but now it shows a '?' At the end of the URL. All we need to do now is remove the question mark.

Georgi_Demirev
Shopify Partner
20 2 13

Hey @Elle, thanks for the reply and taking note to developers.

 

In fact this functionality has been built into the theme itself. What it does essentially is get the product information on-the-fly (variations+add to cart) and append it to the HTML, so a product with variations can be added to cart directly from the collection page.

 

The theme is called Woodmart, you can see their demo and the script in action here. I know theme code is not up to Shopify standards (not up to mine either), but unfortunately we're stuck with it for the time being.

Georgi_Demirev
Shopify Partner
20 2 13

Hello @Elle here's how this is impacting my store for example.

 

Several days ago I noticed that on the search page our AJAX cart is no longer working. Looking into the code I found that the {{ product.url }} output has changed. AJAX pulls product variations directly on the Search page and it needs the URL of product.json so we need to call "/product/product-name?view=json" however when adding additional strings in front of that the js request it no longer valid.

 

So I need to either change the scripts on all my stores or find a different way to get the product.url without the additional strings.

 

If that behavior changes on any other product.url output I'm looking at major sitewide issues.

ddrake112
Visitor
1 0 0
  • When did you first notice this change on your store with the way that your URLs are showing?
A colleague of mine in Miami Florida actually brought this to my attention in July. It is affecting ALL PRODUCTS of 6 Brands catalog. Basically hundreds of products 
  • How is this impacting your business/workflow/ads?
I have been wondering why my google ads for the above mentioned brands are not effective and the reason is this URL issue is effective the SEO and the Google ads. THIS IS A HUGE problem!!
 
I have changed themes, it is still an issue, It is within Shopify - I enter the information in Shopify- I pay Shopify monthly, I expect a solution for this ASAP as if I cannot promote products successfully to sell then my business suffers immensely. 
Karen14
Excursionist
15 0 4

Sorry for the late reply, I retired on the 1st. of July and have neglected to check the email that is associated with this Shopify board. I first noticed this problem back in July 2019 and I did contact Shopify to let them know. They were not at all helpful and any of the 'fixes' that were given through this board did not help. I do hope you are able to find a solution to your problem so that you are not throwing money out the window on your Google Ads.