Possibility to use webp as background img src?

Hi @nikodemsky,

Thank you for your message. I will try to explain you everything below.

It does not matter if the image display as an img HTML tag or you use background-image. It works always!

Below I have attached the instructions:

If you encounter any other qestions, please, feel free to reach out to me.

Best, Mateusz

Ok, that’s cool.

So maybe in meantime you can help me with another thing:

– according to that report image “cancellation-4944727_” is not using webp format even if it’s in default media folder and plugin says that 100% of media files has been converted.

Can’t see it in network either.

https://www.dudkowiak.com/blog/9th-sanctions-package-adopted/
– that’s the page.

Is it possible, that plugin somehow omitted that specific file?

PS. Yes, i have purged all caches at the end of converting 🙂

Yes @nikodemsky – this file was skipped because after converting to WebP the weight of this file was not less than the weight of the original file. This is normal plugin behavior, scheduled.

Why is this happening? You probably set “Conversion strategy” to a higher value than Optimal. Then the weight of the converted files is greater than for the Optimal value.

The simplest solution will be to use the AVIF format (you can read more about it here). Images in the AVIF format are lighter than in the WebP format, so even with the “Lossless” strategy, the image after converting to AVIF will be lighter than the original.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer