2

I'm a server-side developer dabbling in SEO practices for the first time. This question is about getting the url structure right for a web application I'm developing, goal being having some which is search-engine friendly (especially Google).

Background:

The web application I'm developing contains user generated "topics" in which said users can submit bite-sized text/image posts associated to the topic. It's kind of a cross between Reddit and Twitter.

Question:

Imagine a topic for the popular movie Avengers: Foogame on my site. Following are the candidates I have for a URL pointing to this topic (where 1 is topic ID to ensure the URI is unique):

  1. example.com/topic/1/avengers-foogame/
  2. example.com/avengers-foogame/topic/1/
  3. example.com/avengers-foogame-1/
  4. example.com/avengers-foogame/1/

Notice all variations include a topic ID, which is irrelevant from a search perspective. Will it adversely affect the search-engine friendliness of the URLs in question, or can it stay? Moreover, which of the above variations would be the most desirable from an SEO perspective? Or are they all suboptimal?

I would really appreciate getting guidance from industry experts regarding how to tackle this.


To me, it looks like the third option is the best candidate out of the lot. Why? Because I've consistently read that URI tokens (words) are weighted in order of writing, and 3 seems to take advantage of that the most.

I understand that URL structure is but a small drop in the vast ocean of SEO, but I do want to get it right in any case.


Note: this is not a dup of another question regarding url structures and IDs, since that deals with something else entirely.

2

Google doesn't use keywords in the URL path as a ranking signal much right now (maybe even not at all.) Putting keywords in the URL won't change the SEO directly. It will only change the SEO indirectly through better usability. See Are keywords in URLs good SEO or needlessly redundant? which suggests:

  • Use a few descriptive keywords in the URL path for better usability
  • Put the numeric id towards the beginning so that it doesn't get lopped of in cases when the URL gets truncated

As for the slashes vs dashes see Use forward slashes (/) or dashes (-) for URL design in 2019? (for categories in e-commerce) which suggests:

  • Either can work fine for SEO
  • Slashes imply directories, so they should only be used when you plan to support URLs that have been trimmed to the directory level. In your case, that would mean supporting URLs like:
    • /topic/1
    • /topic/

You also might be interested in Does it make a difference if your URL path ends in a trailing slash or not? which says that the trailing slash on your URL isn't needed and just makes your URL more complicated.

Putting that together, I would suggest using the URL:

/1-avengers-foogame

You should also implement URL canonicalization so that all the following get redirected to the preferred URL:

  • /1-Avengers-Foogame (capitalization)
  • /1-avengers (truncation)
  • /1-avengers-foogame/ (additions)
  • /1-avenjers-foogame (misspellings)
  • /1-xyzzy (junk)
  • /1-avengers-foogame?foo=bar (query parameters)
  • Follow-up: does it matter if the nuermical ID appears at the start of the url, versus it's end? Specifically, if more weight is attached to tokens appearing earlier, shouldn't the ID be relegated to the end of the string? – Hassan Baig May 11 at 12:12
  • 1
    I have found that putting it at the end has problems when long URLs get truncated. That can happen in emails, forums, and other software. When the id is at the beginning it is still in the URL even when shortened and you can redirect to the correct thing. The SEO benefits of being able to redirect those malformed URLs far outweigh any possible relevancy you would get from having the keywords up one position. – Stephen Ostermiller May 11 at 19:13

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.