Glossary
DOM (Document Object Model)
The DOM is the browser's in-memory representation of a webpage — a tree of nodes (elements, text, attributes) that JavaScript and CSS act on. A smaller, simpler DOM renders faster and ranks better.
The DOM is what your HTML becomes once the browser parses it: a tree structure where every element, text node, and attribute is a node. CSS selectors target DOM nodes; JavaScript manipulates DOM nodes; the browser's layout engine paints DOM nodes to pixels.
DOM size affects performance directly. Each node costs memory and CPU; a page with 5,000 nodes paints slower than a page with 500 nodes. Lighthouse flags 'Avoid an excessive DOM size' at 1,500+ nodes — most well-built marketing pages sit at 200-800 nodes; problematic pages with heavy page-builders sit at 3,000-10,000+.
What causes bloated DOMs: nested `<div>`s from page-builder plugins (each block wrapped in 3-5 divs), inline tracking pixels that inject script tags, duplicate content rendered in both desktop and mobile templates (instead of CSS-toggled visibility), unminified output from CMS templates.
How to slim a DOM: use semantic HTML (`<section>` instead of `<div className='section'>`), avoid wrapping every block in 3 nested containers, lazy-load below-fold content (CSS `content-visibility: auto` or `IntersectionObserver`-triggered render), and audit with Chrome DevTools' Performance panel + Lighthouse to find the heaviest nodes.
Why this matters for SEO: a smaller DOM is faster to parse, paint, and interact with — which improves Core Web Vitals (LCP, INP, CLS) — which improves rankings. The same content rendered with 500 nodes vs 5,000 nodes can be the difference between LCP 1.2s and LCP 3.5s on a mid-range mobile device.
Example
A WordPress site uses Elementor and ends up with 6,400 DOM nodes on the home page (each section wrapped in 4-6 divs). Lighthouse flags excessive DOM size; INP is 380ms on mid-range mobile (failing CWV). Rebuilding the page on Next.js with semantic HTML drops the DOM to 480 nodes; INP drops to 80ms; rankings improve 6-12 positions across target queries within 60 days.