wp-content » plugins » Alter HTML was skipped because the HTML is too big to process!

Alter HTML was skipped because the HTML is too big to process!

After optimizing a WooCommerce store I noticed the following HTML comment appears at the beginning of every page when viewing the source code:

Alter HTML was skipped because the HTML is too big to process!
Alter HTML was skipped because the HTML is too big to process - Alter HTML was skipped because the HTML is too big to process!
Alter HTML was skipped because the HTML is too big to process!

After troubleshooting the issue, it seems to be caused by the WebP Express WordPress plugin when the feature Alter HTML is enabled with the setting Replace image URLs for pages that have a huge number of DOM elements:

webpexpress wp plugin settings - Alter HTML was skipped because the HTML is too big to process!

Apart from the comment tag, it also means that the WebP Express plugin is NOT replacing the image links and basically no performance enhancement is done for browsers that support it.

To fix the issue you can either tweak the system settings on the server or simply switch to the Replace <img> tags with <picture> tags, adding the web to srcset. setting.

The difference:

Method 1: Replacing <img> tags with <picture> tagsMethod 2: Replacing image URLs
How it worksIt replaces <img> tags with <picture> tags, adding two <source> tags – one for the original image(s), and one for the webp image(s). Browsers that supports webp picks the <source> tag with type attribute set to “image/webp”. It replaces any image url it can find.
Page cachingWorks great with page caching, because all browsers are served the same HTMLDoes not work with page cachingunless you are using the Cache Enabler plugin, which is able to maintain two cached versions of each page.
Styling and javascriptMay break because of changed HTML structure. A selector such as “div > img” will no longer match the image because the immidiate parent is now “picture”.No problems
ComprehensivenessOnly replaces <img> tags – other images are untouchedVery comprehensive. Replaces images in inline styles, image urls in lazy load attributes set in <div> or <li> tags, etc.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended