How to automatic replace all image ipg/png/jpeg to webp

How to automatic replace all existing tags with element and call the function:

example:

<img class=”wp-image-183 size-full aligncenter” src=”https://shopcon.vn/wp-content/uploads/2019/03/cui-quickflex-cho-be-1.jpg” alt=”Cui Quickflex Cho Be (1)” width=”600″ height=”600″ />

to

<picture><source srcset=”https://shopcon.vn/wp-content/uploads/2019/03/cui-quickflex-cho-be-1.jpg.webp” type=”image/webp” /><img class=”wp-image-183 size-full aligncenter” src=”https://shopcon.vn/wp-content/uploads/2019/03/cui-quickflex-cho-be-1.jpg” alt=”Cui Quickflex Cho Be (1)” width=”600″ height=”600″ /></picture>

My website have 500 products with thousands images. I can not add manual the picture tags for 500 products.
Is there a way to add the picture tags faster?

Read more here:: How to automatic replace all image ipg/png/jpeg to webp

Leave a Reply

Your email address will not be published. Required fields are marked *