Section background images in Elementor not being changed to Webp

qtwrk

Well-Known Member
#2
Hi,

Code:
.elementor-41 .elementor-element.elementor-element-42a27ef6:not(.elementor-motion-effects-element-type-background), .elementor-41 .elementor-element.elementor-element-42a27ef6 > .elementor-motion-effects-container > .elementor-motion-effects-layer {
    background-image: url("https://domain/wp-content/uploads/2019/06/test..jpg");
    background-size: contain;
}
Elementor uses CSS to insert background, currently LSCWP can't replace the files in CSS, but our devs have this on to-do list.

Best regards,
 

qtwrk

Well-Known Member
#5
Well , it's still in todo , however, if you are not using any CDN services , then I might have a small trick to workaround it.
 

qtwrk

Well-Known Member
#7
I'm not using any CDN services so I am very interested to hear if there is a workaround to it.
well , this is not a perfect solution , but it should work for you at some point


add

Code:
RewriteCond %{HTTP_ACCEPT} "image/webp"
RewriteCond %{REQUEST_FILENAME}.webp -f
RewriteRule ^(.*).(jpg|png|gif) $1.$2.webp [T=image/webp,L]
to your .htaccess

this will force webserver to send .webp file when 1) browser supports, 2) webp file exists.

the imperfection is that URL will still be same , but "under the hood" file is webp format and thus reduce the image size
 
#9
This issue is still not fixed,my sites are using Elementor and all background images are neither converting to WebP nor getting Lazy-loaded
 

serpent_driver

Well-Known Member
#10
@thatsmehta

If you tried rewrite rule from above there is no converting or replacement as with images that are defined im html <img> tag. Therefore you don't see .webp images in html code. This rewrite rule forces the webserver to send .webp file instead of jpg|png|gif if browser supports .webp images.
 
#11
@thatsmehta

If you tried rewrite rule from above there is no converting or replacement as with images that are defined im html <img> tag. Therefore you don't see .webp images in html code. This rewrite rule forces the webserver to send .webp file instead of jpg|png|gif if browser supports .webp images.
I don't have problem with jpg|png|gif|webp images, my problem is background images via CSS/inline are not being lazy loaded.
 
Top