Use a tags to provide a link to another page

I think it is well known that <a> tag is used as an element to take you to another page, but sometimes I see cases of page links using <button> tag, or using <a> tag or JavaScript.

You may be using this for a specific purpose, but if you want Google's crawlers to crawl through your site, you should use <a> tags.

Because Google's crawlers cannot follow links if they are not proper tags.

The official documentation states the following.

Google can follow your links only if they use proper tags with resolvable URLs:

(omitted)

Google can follow links only if they are an
tag with an href attribute. Links that use other formats won't be followed by Google's crawlers. Google cannot follow links without an href tag or other tags that perform a links because of script events. Citation : Create Crawlable Links | Google Search Central  |  Documentation  |  Google Developers

As shown in the above page, the crawler cannot follow the following code.

  • <a routerLink="some/path">
  • <span href="https://example.com">
  • <a onclick="goto('https://example.com')">

Another example of a ** un-resolvable URLs** is a JavaScript or anchor link, such as

  • javascript:goTo('products')
  • javascript:window.location.href='/products'
  • #

See Also

Please also check the following forum and video for reference.


Author Info
Profile Icon

Director of web and marketing

Kota Shimizu

I've been working in web, video, and magazine production fields, experienced planning, design, photography, coding, marketing, and business improvement. I'm an omnivorous director who can handle anything in a widely.