tags:

views:

350

answers:

7

Hi,

Why is it a bad idea to have a ID in the URL in terms of SEO? How does this:

http://example.com/user/1234

Make SEO bad?

Can someone give me a practical example where the SEPR lowers?

+3  A: 

See this Do SEO-friendly URLs really affect a page’s ranking? question. Based on the answers, no-one can find any proof that IDs in the URLs has any effect on SEO.

Darrel Miller
A: 

It's always a bad idea to provide unusual information. Try the user name instead!

For SEO there is no real advantage/disadvantage between static ID urls and username urls.

Martin K.
+1  A: 

Well, my name is Sudhir Jonathan, so if I want people to find me on your site, example.com/user/sudhir-jonathan is much much better than example.com/user/1234. Simply because the object of your page - "Sudhir Jonathan" - is now present in the url itself. This is a big win.

Similarly, example.com/articles/how-to-bake-a-cake is ranked much higher than example.com/articles/2379797 for the search term "bake a cake".

Sudhir Jonathan
There are many people who share the same name.
rFactor
+6  A: 

It does have an effect of the click-through rate.

The url is presented in green below the search result - so if it contains relevant words the user might click your site and not another site.

Which would you rather click:

www.test.com/page.php?u=85583

OR

www.test.com/Solution-to-your-problem.php

As commented this effect may be achieved even with urls including an id.

In the olden days it search engines treated words in url with much respect and gave those pages extra credit and higher ranking. This effect has almost vanished. We are left with two other effects of readable urls:

  • Clickthrough
  • Linkbuilding: Easier for a human to copy such a url and after the link is copied it is often referred to with some of the slug words. The url with "Solution-to-your-problem" may have Solution to your problem inside the a tag also when people link to your page. This will influence your ranking.

A solution with id + slug might be the best solution and it fixes the problem of keeping track of slug changes. test.com/85583/solution-to-your-problem

But there are some rules to follow, you should do a 301 redirect if the slug is incorrect to prevent a lot of duplicate content pages. Spam/duplicate content detecting kicks in if you got a lot of similiar pages:

test.com/85583/solution-to-your-problem test.com/85583/solution-to-yar-problem test.com/85583/evil-competitor-spamming-you-haha

Including the id also requires your ids to be as short as possible, an url with a full guid might be confusing to the eye and prevent a good clickthrough:

test.com/0CD03822-4A35-11DE-BF38-3F9356D89593/solution-to-yar-problem

Remember that Google News even demanded that you had an id in your url to be included.

Erwin
Why not just do test.com/85583/solution-to-your-problem ? I still see no evidence that ID on the URL makes SEO worse. Some people sometimes claim that so I am interested in knowing whether there are cases when it happens.
rFactor
+6  A: 

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}.

Redbeard 0x0A
+ 1 to this, because you can do this with little or no effort on your part. Notice that http://stackoverflow.com/questions/910683/oh-la-la-la-de-dah also brings us here... you're not doing any kind of search with the slug, just ignoring it.
Sudhir Jonathan
A: 

It simple, search engines care words rather than number. That is to say, it will be better to see keywords in url than just ID sine ID/number is useless for search engines to determine whether your site is relevant or not!

tag
A: 

1) you miss out on keywords in the url 2) it's harder for a human to read and understand what the link will be about 3) sql injection is a lot easier with IDs

henrikpp