13

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.

3

3 Answers 3

10

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.

8
  • Thank 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. Mar 20, 2018 at 17:20
  • 3
    Many sites (including this one) use IDs in URLs and have pretty good SEO. Mar 20, 2018 at 17:33
  • 1
    @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. Mar 20, 2018 at 17:34
  • 2
    You 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.
    – closetnoc
    Mar 20, 2018 at 17:41
  • 2
    @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.
    – Doktor J
    Mar 20, 2018 at 19:49
9

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.

14
  • 1
    What 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? Mar 21, 2018 at 7:39
  • 1
    That’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… Mar 21, 2018 at 15:40
  • 1
    …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)). Mar 21, 2018 at 15:49
  • tl;dr ask Google if you're concerned about it. There's a lot of outdated and incorrect advice on the Internet. Mar 21, 2018 at 17:12
  • 1
    I 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... Mar 23, 2018 at 11:19
1

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.

3
  • 1
    Most sites use their own internal IDs in URLs rather than manufacturer product numbers. Mar 21, 2018 at 18:25
  • Absolutely, 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/…
    – TexasB
    Mar 21, 2018 at 20:21
  • 1
    Having 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. Mar 23, 2018 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.