Will having product ID in URLs hurt SEO compared to a URL with only keywords?
Solution 1
How
- Include the id in a sensible place. Easiest is have .../product/$id/name-of-product etc.
- works with pretty much every routing system, no regexes
- Add a <link rel=canonical> (or however you spell it, it’s a while since I had to do this) to a url with just the id ¹
- When handling requests, if the url doesn't have the correct text then do a redirect to the url with the current correct text in.
Why
When you (inevitably) have to change the text for some product:
- Google will see old and new versions as the same page / entity / product
- old uncorrected links will still “work” (and be redirected to new ones)
- this applies to incoming links from other sites, too, so you don’t lose your “Google sauce” (or whatever the cool kids are calling it these days)
- When (almost inevitably) you have multiple products with the same name (especially if you have a popular item that gets “updated” or “restyled” etc.) but different IDs, both can have a link that works (might help you sell off the old stock)
- you can always add a link to the “new” product on the “old” one’s page
Typoes are inevətəble. If they want to count on keeping product names unique, and never having them corrupted by double-UTF8-encoding or whatever, tell them they get to keep both pieces. Including going through the 404s in the webmaster tools …
¹ This isn’t essential, since a link with the “wrong” text in will redirect anyway. As long as it does have the id in it, it’s more-or-less unbreakable.
Solution 2
You should definitely use the ID version of the URL, as it makes sense for development. In fact, your final URL is still cleaner than a lot of e-commerce URL's out there that still rank.
Google and Bing will still understand that the page concerns Optimus Prime file in the Superheroes directory. The number will just be ignored. Search engines have gotten very good at extracting meaning from content, which includes URL's, but they are not as literal as people often give them credit for. Besides, the URL is only one of the many ranking factors in SERPs; that product ID is very unlikely to move the needle in any direction by itself.
Solution 3
My rep isn't high enough to comment so I will dare to offer an answer. I am an SEO (20+ yrs) and I have a client that, when it comes URLs, I almost always include the model/product number; and I do it for the benefit of SEO. People (I) don't just search by keyword, if there is a product id tied to an item, it only makes sense that they would search by product number as well. And if someone is searching that specifically, they are standing there with money in their pocket wanting to buy. I know ID, product and model numbers might not always be describing the same thing but I find the inclusion to be an enhancement for the SEO and, at the very least, not a hindrance. As someone mentioned, URLs are not final word for Google, I find, in my personal experience, that more weight is given to the page title, but a well built URL still gets you moving down the road.
Related videos on Youtube
Gary Harris
Updated on September 18, 2022Comments
-
Gary Harris over 1 year
Say I have a web shop with a product (optimus-prime), in a category (superheros) such that it has the URL:
www.example.com/superheroes/optimus-prime
Now I want to prepend the product ID (99) to the product name in the URL, so that the URL becomes:
www.example.com/superheroes/99-optimus-prime
In regards to SEO, specifically Google search rankings, does it make any notable difference when using one product URL over the other?
As a programmer, I prefer using the URL with the ID in it because it makes system alias generation 100% fail safe for CMS routing purposes.
-
Stephen Ostermiller about 6 yearsI thought we would have this already asked and answered, but I can't find a duplicate. The closest I found is Does a unique ID and title in URL slug improve SEO? which asks about having the ID and the slug as opposed to just the ID.
-
Doktor J about 6 yearsRelated (but I don't think quite duplicating?): stackoverflow.com/questions/820493/… -- this question asks "will it hurt" while the other asks whether it's permissible at all.
-
Stephen Ostermiller about 6 years
-
-
Gary Harris about 6 yearsThank you for the answer. Exactly the answer I was hoping for. There are probably other SEO folks out there with a different opinion on this, so any kind of external reference to back this up would be appreciated.
-
Stephen Ostermiller about 6 yearsMany sites (including this one) use IDs in URLs and have pretty good SEO.
-
Henry Visotski about 6 years@GeniusDesign I don't have a source - only 8 years of experience. :) But to reverse engineer that: you see plenty of articles saying you shouldn't only use product codes, and plenty saying you should use keywords in product URL's, but not a single one that says anything about using both vs using keywords only. Fact is, it's so hard to avoid ID's in e-commerce website design, and lack of ID's can cause so many issues, that it rarely comes up as an SEO issue.
-
closetnoc about 6 yearsYou are perfectly correct. The id does not add semantic meaning, but also does no harm. The answer is really to what is easier between the two examples.
-
Gary Harris about 6 yearsMy situation is that I work as a programmer / system developer in a web bureau, where some of my colleagues are SEO perfectionists, and I know I need to have a real good argument for my position on this matter. As I said before, in a CMS technical sense, including the product ID as a prepend to the product "slug" is much cleaner and safer for system routing.
-
Henry Visotski about 6 years@GeniusDesign I feel your pain - I've been in those meetings. I think you can challenge them to come up with evidence to the contrary. I'll be surprised if anyone comes up with a reputable source. And you can always use this thread, too. closetnoc and Stephen have been doing this longer than I have, and we all have consensus.
-
Gary Harris about 6 yearsThank you :) I do hope that having feedback from all of you guys with this level of consensus will help me make my case.
-
Doktor J about 6 years@GeniusDesign while it's hardly "authoritative", KissMetrics has an article describing "speaking URLs" (see #6) and their good example includes an ID; the point they're trying to stress is having descriptive/index-able words in your URL; the fluff gets ignored.
-
Gary Harris about 6 yearsWhat a beautiful solution :) Regarding <link rel=canonical> I have a question: Let´s say I submit a product URL in sitemap like this: www.example.com/superheroes/991/optimus-prime When the canonical tag is there will Google then include the submitted URL or the canonical URL in search results? I want to make sure that the Google search result links to this page: www.example.com/superheroes/991/optimus-prime and not: www.example.com/superheroes/991/ Or is this not a sensible think to be concerned about?
-
Will Crawford about 6 yearsThat’s a good point, and I can’t entirely remember. The “canonical” tag is mostly about telling Google that if there are multiple “views” of the same thing, one of them is the “original”, so you don’t dilute the value of the page by splitting it among several pages relating to the same thing…
-
Will Crawford about 6 years…but you can have a canonical URL that redirects. So I’m not really sure what’s best in this case. It shouldn’t matter which URL appears in the search results, if the snippet displayed is relevant; though I know some SEO people will claim users prefer the nice-looking link, I notice the link text more (and pages with links like webmasters.stackexchange.com/q/45145 show up well enough in search results :o)).
-
Will Crawford about 6 yearstl;dr ask Google if you're concerned about it. There's a lot of outdated and incorrect advice on the Internet.
-
Stephen Ostermiller about 6 yearsMost sites use their own internal IDs in URLs rather than manufacturer product numbers.
-
Josh Stafford about 6 yearsAbsolutely, and sometimes inventory is managed by SKU numbers or UPC codes. sideshowtoy.com/collectibles/… for example. 902953 being the sku number. And when you search using using the sku no. as a modifier you get results using the sku in the URL and some without. google.com/…
-
Gary Harris about 6 yearsI have 1 important note to make regarding placing the ID between 2 slashes. This can become a problem in routing scripts if a user enters the URL in a browser without product slug and without trailing slash, like this: www.example.com/superheroes/991 as opposed to: www.example.com/superheroes/991/ You will not be able to make a script that can isolate the ID from the URL consistently. Having the URL like this, makes ID isolation 100% fail safe: www.example.com/superheroes/991-optimus-prime regardless of trailing dash. See method in my next comment...
-
Gary Harris about 6 yearsHaving the system ID in the URL doesn´t mean you shouldn´t also include the model name/number in the URL, if it makes sense in your particular situation. If the model name/number adds semantic value / keyword value to the product slug, of course you should consider also including the model name/number in the URL.
-
Gary Harris about 6 years*** dash = slash
-
Gary Harris about 6 yearsOf course before you use my method you should strip the URL from any URL parameters
-
Will Crawford about 6 yearsEr, putting the ID separately means it is easier -- it's always the nth component of the URL.
-
Gary Harris about 6 yearsI don´t think you understand my point. If you put the ID between 2 slashes you can only count on having the ID as 2nd last array item when exploding the URL, if there is indeed a slash after the ID. As I explained you could potentially have a situation where the URL is without product slug and trailing slash, and then you have a problem.
-
Will Crawford about 6 yearsWhy are you counting from the end?
-
Gary Harris about 6 yearsThe base URL components are defined by the delimiter / (slash) and the last component is the slug. If you then position the ID before the slug it becomes the 2nd last component of the URL.
-
Gary Harris about 6 yearsThis method of isolating the ID is important in various situations, e.g. if you want to code an automated 301 redirect script for EOL URLs, and you cannot consistently do that when it is not guaranteed that the ID is positioned where you expect it to be.
-
Gary Harris about 6 yearsNot all CMS components have a simple structure like: domain/category/item Sometimes you have deeper category trees, where the URL could look like this: domain/category/category2/item