Skip to the indexed answers
Digital Marketing Index

usdigitalmarketingindex.com SEO

Why might content revealed only after clicking a button remain unseen by Google?

Because Google does not click. If the content is fetched from the server only when a visitor presses a button, it is never in the page that Google renders, and so it cannot be indexed. Google’s documentation states that “Google Search does not interact with your page” (Google’s guidance on lazy-loaded content), and that its crawlers “don’t “click” buttons and generally don’t trigger JavaScript functions that require user actions to update the current page contents” (Google’s guidance on pagination and incremental page loading). The exception is content that is already in the page and merely hidden from view until the click. That content is in the HTML, and Google can read it.

Interaction-dependent rendering

A button can do one of two things.

What the click does Is the content in the rendered HTML before the click? Can Google see it?
Shows an element that was already in the document Yes Yes
Requests data and inserts it into the document No No

Everything turns on that distinction. The visual result is identical for a visitor. The document a crawler reads is different.

Patterns that fetch on interaction:

  • A read more button that loads the rest of an article
  • Tabs whose panels are requested when selected
  • A load more button on a product list
  • Reviews, specifications, or FAQs loaded when a section is opened
  • Content that appears on scroll, hover, or after dismissing a dialog

Hidden versus injected DOM

Two versions of a toggle make the difference concrete.

Content already in the document, hidden until the click:

<button type="button" aria-expanded="false" aria-controls="specs">
  Show specifications
</button>
<div id="specs" hidden>
  <p>Weight: 280 g. Drop: 4 mm. Lug depth: 5 mm.</p>
</div>

<script>
  const button = document.querySelector('button');
  const panel = document.getElementById('specs');
  button.addEventListener('click', function () {
    const open = button.getAttribute('aria-expanded') === 'true';
    button.setAttribute('aria-expanded', String(!open));
    panel.hidden = open;
  });
</script>

The specification sentence is in the HTML from the start. The click changes its visibility.

Content fetched on the click:

<button type="button" id="load-specs">Show specifications</button>
<div id="specs"></div>

<script>
  document.getElementById('load-specs').addEventListener('click', function () {
    fetch('/api/specs/trail-shoe')
      .then(function (response) { return response.text(); })
      .then(function (html) {
        document.getElementById('specs').innerHTML = html;
      });
  });
</script>

Here the panel is empty until someone presses the button. A renderer that does not press it finishes with an empty panel.

Crawlability test

Check any click-dependent content with three steps.

  1. View the page source, or fetch the page without scripts, and search for a sentence from the hidden content. If it is there, the content is in the served HTML.
  2. Run a live test in Search Console’s URL Inspection tool and search the rendered HTML for the same sentence. If it is there, Google’s renderer has it without any click.
  3. After the page has been indexed, search Google for the exact sentence in quotation marks.
Result Meaning
Present in served HTML Visible to any crawler
Absent from served HTML, present in rendered HTML Added by script on load; visible to Google after rendering
Absent from both Depends on interaction; not visible

A browser’s element inspector is not a substitute for step 2 if you have already clicked. Reload the page and inspect before interacting.

Accessible alternatives

Keep the interaction and change where the content lives.

  • Put the content in the HTML and hide it. Use the hidden attribute or CSS, with a real button and aria-expanded, as in the first example. The native details and summary elements do this without script.
  • Render the first set of items on the server, and let the button add more. For a list, give each further set its own URL as well, with a normal link, so the load more control is an enhancement over working pagination.
  • Load on visibility, not on action. Where deferring is needed for performance, load content when it enters the viewport. Google’s lazy loading guidance describes this approach and notes that such methods “don’t rely on user actions, such as scrolling or clicking”.
  • Give long content its own page. If a tab holds a large body of material, a separate URL linked from the page may serve readers and search better.

Hidden content is not a loophole. It should be the same content any visitor gets by clicking, placed in the page for their convenience. Text hidden from visitors and placed for search engines alone falls under Google’s spam policies on hidden text.

Decide per component.

Content Importance for search Recommendation
Core description, specifications, main body High In served HTML
Secondary detail a visitor expects on the page Medium In HTML, collapsed
Long lists beyond the first screen Medium Paginated URLs, with load more as enhancement
Personal or session-specific content None Fetch on demand

After changing an implementation, repeat the three-step test and confirm the sentence now appears in the rendered HTML.

Links are a special case of the same problem. When the links a crawler needs are inserted only after a delayed data request, discovery suffers in a similar way, as described in the guide to how links inserted after delayed API responses become difficult for crawlers to discover.

The rule: if a click reveals it, Google can read it. If a click fetches it, Google cannot.

Link trail

Reader comments on this answer

Add your comment to this answer

Your email address will not be published. Required fields are marked *