2

I have the following UI:

enter image description here

There are tabs which are <button>'s and when you select one there will be <a>-Links to different pages. It seems like Google will only index the Links on the first page (which is open by default) and not click the other buttons to the following links. The UI is built with react so only the links which are currently visible are in the HTML.

How can I achieve that Googlebot will also index the links of the other pages? Is it possible to tell the Googlebot to click a button? Any experiences?

Lars Flieger
  • 153
  • 7

2 Answers2

3

Googlebot does not simulate any user interaction with the page. It doesn't click, scroll, or type. There is no way to make it do so.

What Googlebot does instead is to scan the document object model (DOM) and look for links to follow. That leads to two potential solutions to your problem:

Put all the tabs in the DOM

If all the tabs' content are in the document, Googlebot will follow all the links, even if some of the tabs are currently hidden. Rather than implement the tabs such that the content gets loaded via AJAX when the user clicks, you can implement them so that all the content for all the tabs is loaded at page load. Then when the user clicks, the current tab can be hidden and the other tab shown.

Convert the buttons to links

Alternately, you can assign a different URL to each tab and convert each tab to link rather than using a button. Then Googlebot will discover each tab as its own page to crawl. When it crawls each tab, it will see the content and be able to crawl all the links.

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364
1

There are many ways to do this, you should do as many as you can. For example -

  1. Put the url of the pages that the buttons generate, them in your sitemap.xml
  2. Link One page to another at the bottom with something like See Also
  3. Have a sitemap page and put all the links there.
Rohit Gupta
  • 2,933
  • 3
  • 11
  • 28