SEO

DOM (Document Object Model)

Also called Document Object Model, rendered DOM

The tree-shaped, live version of a web page that a browser builds from HTML and that JavaScript can change; search engines index the rendered result.

Quick facts: DOM (Document Object Model)

Category
SEO
Also called
Document Object Model, rendered DOM
Level
Advanced
Affects
Indexing of JavaScript content, link discovery, Interaction to Next Paint, structured data
Where to see it
Chrome DevTools Elements panel, URL Inspection in Google Search Console, Screaming Frog with JavaScript rendering, Lighthouse
In this article4
  1. How the DOM works
  2. Why it matters
  3. Common mistakes
  4. How to act on it

The DOM (Document Object Model) is the live, structured version of a web page that a browser builds in memory from the HTML, and that scripts can read and change. When SEOs talk about the “rendered DOM”, they mean the page as it exists after JavaScript has run, which can be quite different from the HTML file the server sent.

How the DOM works

A browser receives HTML as plain text and parses it into a tree of nodes: the document at the root, then the head and body, then headings, paragraphs, links and images nested inside them, down to individual pieces of text. That tree is the DOM. CSS is applied to it to work out what appears where, and JavaScript can add, remove or rewrite any node at any time.

This is why viewing the source and inspecting an element show different things. View source shows the original HTML response. The Elements panel in Chrome DevTools shows the current DOM, including everything scripts have inserted since: a product grid fetched from an API, a review widget, a cookie banner or, on a fully client-side app, almost the entire page.

Google works the same way. Googlebot fetches the HTML, queues the page for rendering in a recent version of Chromium, and indexes the rendered result. Rendering usually follows quickly, but it is a second step that can fail or time out, and some other crawlers, including several AI crawlers, do not run JavaScript at all.

Why it matters

Search engines can only rank what ends up in the version of the page they process. If the main copy, internal links or structured data exist only after a script runs, you depend on that script working for every crawler. Content that loads only after a click, or only when a scroll event fires, may never be seen, because crawlers do not click buttons or scroll the way people do. Links built as buttons with JavaScript click handlers, instead of proper anchor elements with an href attribute, are generally not followed.

DOM size affects speed as well. Page builders often wrap each visible element in several layers of containers, producing pages with thousands of nodes. A large, deep DOM takes longer to style and lay out, uses more memory on mid-range phones and makes every tap slower to respond, which shows up in Interaction to Next Paint. Lighthouse flags an excessive DOM size for exactly this reason.

Common mistakes

  • Checking only the source. Auditing raw HTML misses problems scripts introduce, such as a second canonical tag or a noindex added by a plugin.
  • Checking only the rendered DOM. The reverse mistake: a page that looks complete in DevTools may send almost nothing in its HTML, leaving non-rendering crawlers with an empty shell.
  • Tabs and accordions that fetch content on click. Text tucked into an accordion is fine if it is in the DOM on load; text loaded only when someone clicks is not.
  • Bloated page builder markup. Ten nested wrappers around a single heading slow every page that uses the template.
  • Scripts that rewrite titles or meta tags. When the rendered value differs from the HTML value, you cannot be sure which one each search engine uses.

How to act on it

Compare the two versions of your key templates. In Google Search Console, the URL Inspection tool’s “View crawled page” option shows the HTML Google rendered. Set it beside your source HTML and check that the main content, headings, internal links, canonical and structured data are present without depending on any user action. A crawler such as Screaming Frog can do the same at scale with JavaScript rendering switched on and will list content that exists only in the rendered version.

Where important content relies on client-side scripts, consider moving it into the server response through server-side rendering or static generation. Trim DOM size by simplifying page builder sections and removing unused widgets, and use semantic HTML so the structure carries meaning. If you are unsure where the gaps are, a technical SEO audit includes a rendered-versus-source comparison for each template.

Do and do not

Do

  • Compare source HTML with the rendered DOM on key templates
  • Use real anchor elements with an href for links
  • Keep page builder nesting shallow

Do not

  • Load important text only after a click
  • Let scripts rewrite titles or canonicals
  • Assume every crawler runs JavaScript

Questions people ask about this

Is the DOM the same as HTML?

No. HTML is the text the server sends; the DOM is the structure the browser builds from it, which then changes as scripts run. On a simple static page the two match closely. On a JavaScript-heavy site the DOM can contain far more, or quite different, content than the original HTML.

Does Google see content that JavaScript adds to the DOM?

Usually, yes. Google renders pages and indexes the rendered DOM, provided the scripts can run, are not blocked by robots.txt and do not need a click or scroll to load the content. It is still safer to have critical content and links in the initial HTML, because rendering is an extra step and not every search or AI crawler performs it.

How big is too big for a DOM?

There is no ranking threshold. Lighthouse warns when it considers a page's DOM excessive, and the practical effect is slower styling, layout and interaction, especially on cheaper phones. In my judgement, if a straightforward content page has thousands of elements, the page builder or theme is adding more structure than the content needs.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.