Non-descriptive link text

Full URL address is linked instead of text

Updated over a week ago

Type of policy: XPath

What it is used for: A common accessibility no-no is to create a link where the link text is the address for the link. Screen readers will often read these links letter by letter. For instance, a link embedded as http://google.com may be read as h-t-t-p-:-/-/-g-o-o-g-l-e-.-c-o-m. This Custom Policy will identify cases where "http" or "www" are a part of the link's text.

How to set it up:

  • Use XPath

  • Set policy to “Flag pages that contain the XPath"

  • Use the following: 

//a[@href and @href !="" and normalize-space(text()) !="" and (@href=text() or contains(text(),"http") or contains(text(),"www."))]

Learn more by reading our Create a Custom Policy article.

Did this answer your question?