How can I reduce DOM size effectively?

Hi

Im trying to fix this dom size by removing unnecessary apps as well as jscode but still i get this please help me out

as well as large contentful print

i have also visited

Hi @blackberry

For Pagespeed to flag your page and respectively - display the “Avoid an excessive DOM size” warning in your PSI report, either of the following errors must be true for its DOM tree:

  • It has more than 1,500 DOM nodes in total.

  • It has a maximum node depth greater than 32 nodes.

  • A parent node has more than 60 child nodes.

    Effect of large DOM -
    1- Increased rendering time
    2- Overwhelms the memory resources of your user’s device
    3- Increased Time to First Byte (TTFB)
    4- larger DOM means slow loading website.

Here is how you can fix this -
1- Avoid poorly coded apps and themes.
2- Minimise use of js on the page - remove any un necessary javascript.
3- If the page is very large, make it smaller, more some elements to other pages.
4- Make sure there are no hidden elements on the page.

This should fix the issue you are facing.

If you can not make a lot of changes on the page then you can try using https://websitespeedy.com to fix LCP, Vitals and boost page speed , this will improve loading speed by improving other factors like render blocking and by implementing other techniques for speed optimization.

Thanks