identical-links-same-purpose
Links with the same accessible name should lead to the same destination
Flags groups of links that share the same accessible name but resolve to more than one distinct destination, for manual review of whether they serve the same purpose.
Applies to. Sets of two or more a[href] elements, or elements whose role attribute resolves to link (its first real role token, in any case), that share a non-empty accessible name (trimmed, whitespace-collapsed, case-folded), as in ACT b20e66. A link whose name no other link shares has nothing to be compared with. A custom element whose ElementInternals give it the link role (this.attachInternals().role), with no role attribute naming another, counts as a native element with that role does.
Expectation. Within a page, links that share the same accessible name are expected to serve the same purpose (i.e. resolve to the same destination, the full resolved URL, including any fragment). Same-text-different- destination links are common and frequently intentional in real sites (e.g. repeated "Read more" links per article card), so this is authored as type: 'manual' (cantTell-capped, never fail) rather than a hard fail, flagging a real name/destination mismatch for human judgment instead of guessing intent.
What a finding reports.
name: the accessible name the links share, trimmed, with whitespace collapsed and in lower case.href: the full URL this link leads to.distinctDestinationCount: how many different URLs the links with this name lead to, a count of 2 or more.linkKind: what this link is made of (helpers.getLinkKind):svgfor an<a>in SVG;imagefor an<area>, or a link whose content is only images (<img>,<svg>,<object>,<canvas>,role="img");compositefor text and an image;textotherwise, a link with no content (named by its attributes) included.
These data.details fields help to read and reproduce a finding. Apart from reasonCode and the few fields Output schema names as stable, they are not a stable contract: a field may be renamed or dropped in a minor release, so don’t build on them.
Examples
<a href="/contact">Contact us</a><a href="/contact">Contact us</a>
Both links named "Contact us" lead to the same page.
<a href="/articles/1">Read more</a><a href="/articles/2">Read more</a>
Both links share the accessible name "Read more" but resolve to different destinations.
<a href="/articles/1">Read more: Quarterly results</a><a href="/articles/2">Read more: Product launch</a>
Each link's accessible name is distinct, so there's no same-name group to compare destinations within.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
SAME_NAME_DIFFERENT_DESTINATION
- Find all links with the name the report gives (a screen reader's links list helps) and note where each leads.
- Open each link and compare the pages it reaches.
- Decide whether the pages serve the same purpose (the same page with tracking parameters, or equivalent pages) or different ones.
- If they lead to different kinds of pages, check whether the page offers a way to make link names say more, such as a setting that shows the full link text. It only counts if you can turn it on with the keyboard and, with it on, every link name says where it leads.
Pass. Every link with this name leads to the same page or to pages that serve the same purpose, or a setting you can turn on with the keyboard makes each link name say where it leads.
Fail. Links with the same name, such as "Read more", lead to pages with different purposes and nothing on the page lets their names tell them apart, which fails WCAG 2.4.9 (ACT b20e66).