What is DOM size?
Also called: Page size in elements, Excessive DOM size
A browser turns your page into a tree of elements called the DOM. Page builders, hidden menus, sliders and repeated blocks can add thousands of elements that nobody sees.
Why it matters
Each extra element costs memory and time whenever the browser lays out the page or something on it changes. On a phone this makes the page slower to open and slower to respond to taps. Google's Lighthouse tool warns above about 800 elements and flags pages above about 1,400.
How Onbiom checks it
Onbiom's rule: we open your homepage in our own browser, let its scripts run, and count the elements inside the body. It fails above 1,400. From 800 to 1,400 it passes with a note to stop it growing.
If our browser could not open the page this time, the result is unknown and is not counted in your score.
In your report this appears as: Homepage with a manageable number of elements.
How to check it yourself
- Open your homepage in Chrome, press F12 and open the Console tab.
- Paste the line below and press Enter. The number is your element count.
document.body.querySelectorAll('*').lengthNot sure about your own site? Paste your address and see in a minute which of these checks your site passes. Free, no account needed.
How to fix it
- Any website
- Remove sections nobody uses, hidden copies of menus (many themes build one menu for phones and a second for computers), and repeated blocks such as long logo strips.
- Long lists
- Show the first part of a long list of products, posts or reviews and load more when people scroll or press Show more.
- Page builders
- Builders often wrap each block in several layers. Use simpler layouts for heavy sections, and switch on the builder's option for leaner output if it has one.
Related terms
Sources and further reading
Last reviewed: