Settings - Replace in the JS blocks

Some plugins or themes have galleries or other effects where images are served in JavaScript blocks, either separate JS files or inline JS snippets. For example, you may have a little script on your homepage that sets a background image like this:

<script>
	function changeBackgroundImage() {
        	document.body.style.backgroundImage = "url('https://example.com/wp-content/uploads/image.png')";
	}
	document.addEventListener("DOMContentLoaded", changeBackgroundImage());
</script>

If this is the case, you will need to enable this option if you want ShortPixel AI to optimize these images. Once enabled, you will also be able to choose to lazy load these images. If you don't lazy load them, the images will not be able to be properly resized either.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us