4

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

2
  • 2
    Whenever an HTML document is re-rendered as an image, such as by being printed on paper or converted to an image document, a person reading the imaged text will have access to the URL only if the URL is visibly included in the content, such as by being made the text content of the <a> element. LIkewise, if somebody reads the HTML document out loud to somebody else or records it orally for others to hear and does not take steps to discover and read out loud the URL, the listening person will not know what the URL is if it is made invisible and thus will be unable to use the URL. Commented Sep 12, 2022 at 10:39
  • @JonathanPool That's a good point. As a teacher I've had to compromise on formatting documents that have nice links for those who view them online ("Here is an APA template to start your work") and the fact that when printed and distributed, the links are inaccessible. My compromise is to go to tinyurl.com or other link shorteners and put in the document, "Here is a link to an APA template to start your work: tinyurl.com/apa-template" (as an example). Commented Sep 12, 2022 at 11:26

1 Answer 1

6

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

3
  • 1
    Also, in OP's example with the URL anchor, it's not clear what the URL is. What is mypage? How could I guess it's the "Example", or whatever it is. Without context it's unclear.
    – BruceWayne
    Commented Sep 12, 2022 at 1:45
  • 1
    @BruceWayne Indeed. I was going to say more about that undescriptive text but I figured as just "Example", OP probably didn't mean it as representing good anchor text. Commented Sep 12, 2022 at 10:20
  • 1
    What is used as the URL in the a anchor text was not really relevant to the" question. It is just an example in case people do not know what "anchor text" refers to Commented Sep 12, 2022 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.