Seo
Links are crawlable
Conducting a code audit to verify the crawlability of links is vital for search engine optimization and indexing, as it ensures that search engines can navigate and index a website's content effectively.
Search engine crawlers are able to follow the links of your website
exclusively if they use proper <a>
tags with resolvable URLs:
<a class="underline">A link without href is not crawlable</a>
<a href="/path/to/file.hgtml" class="underline">This is a crawlable link</a>
Search engines can follow links only if they are an <a>
tag with a href
attribute.
Links that use other formats won't be followed by Google's crawlers.
Google cannot follow <a>
; links without a href tag or other tags that
perform a links because of script events.
Fixing the problem
If you must use an a
element at least add a href attribute with a dash:
<a href="#" class="underline">An anchor pointing to the document itself
</a>
If you can use a different element use a div
element with an onclick
event:
<div href="#" onClick="window.open('/path/to/file.html')" class="underline">
An anchor pointing to the document itself
</div>