大网数据广告活动
网站运营与故障问答

Using URLs as anchor texts

· 52CE 我爱测

If using a URL as anchor text (= visible link text) - is this bad practice and why? Are there any good reasons to use a URL as anchor text? Example: URL as anchor text: <a href="https://example.org/mypage">https://example.org/myp…

问题原文

原帖链接 · Sybille Peters · CC BY-SA 4.0

If using a URL as anchor text (= visible link text) - is this bad practice and why? Are there any good reasons to use a URL as anchor text?


Example: URL as anchor text:

<a href="https://example.org/mypage">https://example.org/mypage</a>

Example: Text as anchor text:

<a href="https://example.org/mypage">Example</a>

Consider accessibility, usability, SEO ...


Don't use the page's URL as the link description unless you have a good reason to do so, such as referencing a site's new address.

web.dev: Link text best practices

已采纳解答

原帖链接 · Luke Sawczak · CC BY-SA 4.0

Some reasons I might not do so:

  • The URL is probably uninteresting to most users. Often a link is integrated into a sentence and a URL doesn't integrate well.1

  • These days, with fancy search bars and whatnot, a site title is usually as reliable a way to find it as typing an exact URL. If I did supply a URL, it would be chopped to the bare minimum of example.com, since that gets them where https://www.example.com does anyway (with modern HTTPS redirection), with a lot less typing.

  • While it might seem more transparent, it opens the door to worse abuses since you can put any URL as the text pointing to any other URL. The illusion of security is even worse than the knowledge of insecurity.

  • Since the URL is available to a savvy user in the status bar, the text is a way to add more information about it for free. If it were a link for josephextraordinarilylongname.example my anchor text could be "Visit the creator's website" and some users would be able to glean that Joseph Extraordinarilylongname is the creator.

Some reasons I might do so:

  • As the recommendation you cited says, if you're saying something about the URL itself and not the website, you would want to show the URL. For example, "We have moved to newsite.example!"

  • Similarly, to talk about a site as a domain. This might seem a little constructed, but suppose I said, "I run three websites. On myfirstwebsite.example, you'll find... On mysecondwebsite.example,..." This would be analogous to a YouTube creator spelling out their different channel names instead of just saying "Subscribe!"

  • In lists of resources, sometimes it's handy to have a unique identifier. Yesterday I was searching up cottage rentals. All the cottage rental sites have nearly identical names. So an aggregate site, rather than saying "Visit Cottage Rentals Canada, Rent Cottages Canada, Rentals Canada for Cottages", etc, might list URLs so I can tell them apart.


1 That said, I do hate over-integration, where articles on content churn sites will turn every last phrase into a link to something you could never guess from the anchor text...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-09-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。