Archived topic
Excessive DOM size 4293 elements
10 replies · Started by Mathieu on June 25, 2022
Hello team,
I just migrated my site using generatepress https://www.justificatif-de-domicile.fr/, because I was previously using a wordpress builder that I wanted to eliminate, for performance issues.
Unfortunately, after going online and using the pagespeed, I see the error: Have excessive Dom size - 4293 elements.
As I know that generatepress is pretty well optimized, I must have made a mistake... but I can't figure out which one!
Would you have an idea?
Thanks
Hi there,
Any chance you can disable all plugins except GP Premium to eliminate conflicts from other plugins first?
Let me know :)
Hi Leo,
Thanks for your fast answer :)
I just did it, keeping GP Premium + generateblocks, but unfortunately this is still the same : https://prnt.sc/FE1tW9pWgB7D
I've been reading others posts on this forum talking about same problem, like on https://generatepress.com/forums/topic/avoid-an-excessive-dom-size-1449-elements/ where David recommends to reduce the number of elements on a page.
But my homepage is relatively clean and short, I don't see how to reduce it.
Is this DOM linked to the elements of the whole site?
How many elements have you created under Appearance > Elements?
There is 9 éléments.
Hi there,
on your PSI Report under: Avoid an excessive DOM size 4,263 elements if you expand that diagnostic you see:
Maximum Child Elements: <div class="fc-preferences-container">
Which i tracked down to being part of your Cookie Consent form container. So Google is seeing that on its tests, as its not going to consent to your cookies or cache the load.
And now see here - look how many nodes that cookie consent is creating:
https://www.screencast.com/t/5vqEbZvR2R
Have a chat with the cookie consent author about this.
Hi David,
Thanks for the premium response!
Indeed, I just deactivated the consent author cookie and I don't get this error message anymore on pagespeed.
I'm really surprised because the consent author cookie is no other than .... the one from Google Adsense itself !
For all those who would have the same problem as me, it is probably enough to use a third party solution
Thanks for the efficiency and the availability of the Generatepress team !
Well at least Google are consistent, thats another one of their 'products' that fails their own web dev metrics lol
I see a lot of users in this forum use the Complianz plugin for GDPR / Cookie consent.
Glad to be of help.
You are 100% right David :)
By removing the tag provided by adsense for the RGPD consent, the page speed of my page went from 55 to ... 99.
Good to know for all users !
Glad to be of help