2

I'm faced with a decision with creating my paths and not sure which would have the best ranking approach.

  1. example.com/product/[slug]-[uuid]
  2. example.com/product/[uuid]-[slug]
  3. example.com/product/[slug]
  4. example.com/product/[uuid]

The argument for putting the uuid first or only is it's a deterministic path and it never changes.

The argument for slug is human readable urls are supposed to rank better but our slugs might change.

Would a canonical url's approach be different?

2
  • Universally unique IDs (UUIDs) are usually very long, too long for URLs. Is there are reason you can't use a shorter locally unique ID to make your URLs shorter? Mar 18, 2021 at 19:54
  • I am assuming you mean a numeric id and not an actual uuid. If so, I would go with /product/slug/id. I would expect that if the DB reaches a large enough size, you would rather search for products based on a numeric ID than a string. Mar 18, 2021 at 20:35

1 Answer 1

1

Number 3 - just the slug will likely give you a (marginal) SEO advantage over the other options, all else being equal. To the extent that canonical implies "authorative & original address" the URaL makes little difference - but again a slug is likely easier to remember.

Id suggest the only reason to use a UUID over a slug us if you have large swaithes of content or lots of similar content.

2
  • The ID can be very important in URLs for SEO in two cases: 1. If the slug is long enough that it is likely to get truncated. Then having the ID can help recover and redirect. 2. If the slug for a page can change (for example if it is computed from an editable page title). Then the ID is important for implementing redirects. Mar 18, 2021 at 19:58
  • @StephenOstermiller you raise good points. I think our definition of a slug is differs - I don't think a slug can change, as it is not something that is updated from an editable page - rather it is a unique identifier of the page which includes meaning understandable to humans. In Wordpress for example a slug is initially derived from the title, but even if you change the title - or even all the contents of the page, the slug remains the same.
    – davidgo
    Mar 18, 2021 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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