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

2019-01-19 01:34发布

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?

标签: url seo
7条回答
Fickle 薄情
2楼-- · 2019-01-19 02:05

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

查看更多
唯我独甜
3楼-- · 2019-01-19 02:11

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

查看更多
4楼-- · 2019-01-19 02:12

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.

查看更多
等我变得足够好
5楼-- · 2019-01-19 02:14

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.

查看更多
Fickle 薄情
6楼-- · 2019-01-19 02:20

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!

查看更多
Animai°情兽
7楼-- · 2019-01-19 02:23

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

查看更多
登录 后发表回答