Search code examples
urlseosearch-engineslugidentification

Why is just an ID in the URL path a bad idea for SEO?


Why is it a bad idea to have a ID in the URL in terms of SEO? How does this URL http://example.com/user/1234 hurt SEO?

Can someone give me a practical example where search engine rankings are worse?


Solution

  • The reason people are saying that {ID} in the URL is bad is due to the way search engine algorithms work. When a search term is located in the actual URL, it is weighted much more heavily than the content of the page, etc.


    For example:

    <!-- http://example.com/blog/57 -->
    <html><head><title>An article on search engine optimization</title>...
    

    vs

    <!-- http://example.com/blog/an-article-on-search-engine-optimization -->
    <html><head><title>An article on search engine optimization</title>...
    

    If you do a search in Google for "Search Engine Optimization" the second page, the one with the slug in the url will weight as a better result than the one with only the id.


    You can deal with this in the same way that stack overflow deals with this issue:

    http://stackoverflow.com/questions/{id}/{slug}
    http://stackoverflow.com/questions/910683/why-is-id-in-the-url-a-bad-idea
    

    The combined id and slug format really helps you achieve the best of both worlds. You get the ease of programming by retrieving records by {id}, but you also retain the optimized search URL because of the {slug}.