28 Feb 2023
- Comments (1)
The role of WebP in developing a sustainable WordPress site
They say that a picture is worth a thousand words, but in the digital world, a picture is worth much, much more. “World Wide Waste”, a brilliant book by Gerry McGovern has 51,000 words and only one, black and white image on the cover. Its EPUB file has only 0.34 MB, whereas a random picture of my dog in my phone is around 5 times bigger. Images are extremely important to us humans and we have been using them to communicate for 40,000 years, but do they really have to be such a ballast to our environment?
Huge images = huge problem in the digital world
Page weights are increasing every year (the largest desktop page detected by HTTPArchive weighs 678 MB), which takes more and more bandwidth. 99.9% of websites generate at least one image request and statistically, 43% of total page weight is images. If you are here, you probably know how important the weight of a website is for the environment. But did you know that only 66% of households in the world have access to the Internet? And yes, we in highly developed countries inflate the statistics with our 91% home internet coverage. So if you want to add a nice photo to your site, think of all the people who will see a perpetually buffering badge instead of your photo. Or about those who will actually see your photo, but then won't have internet for a few weeks because they've used up their mobile network limit.
But it doesn't have to be like that. We wrote quite a lot about image format and how important it is, but as we can see from the statistics above, there is still a huge opportunity for improvement. WebP, one of the modern formats, is gaining popularity lately and that's great news. It’s supported by almost all browsers now and it’s almost 30% smaller compared to JPEG and PNG. You can read more about it in one of our articles.
WebP is fully supported by WordPress
Already around 10% of websites use WebP (as of 2022) and it’s increasing every year. Since WordPress 5.8 you can use them on your WP website without any additional plugins. That’s true, images in WebP format are now fully supported in WordPress. You can use them as any other images you used before, and take advantage of [srcset] and lazy loading. That means that your website will be even faster and more sustainable. And it’s so simple!
Converting images to WebP
To change the format of your images before adding them to your WordPress website, simply convert them with your favorite converter. If you don’t have any just check some of the most popular ones, like tinypng.com or Convertios. You can find more information in this article.
It is very likely that by reading this article you already have an existing website. So if your media library is full of JPEG or PNG images, don't worry, you can always use a converter/optimizer plugin, like Converter for Media. After activating this plugin, simply go to its page in the admin panel. There you head to the ‘Bulk Optimization of Images’ section and start the conversion process. A few minutes (or hours, depending on the size of your media library) later, you can enjoy your new image format. This plugin doesn't change URLs to images but instead changes MIME type, so if you want to be sure it worked well, just go to Dev Tools in your favorite browser and check in the "Network" section.
Future of images in WordPress
WordPress doesn't stop there. Adding WebP support to WordPress is a step in the right direction regarding image optimization and faster loading, but they also keep an eye out for the latest formats like AVIF and JPEGXL. As technology advances and internet speeds increase, we can expect more efficient image formats and compression techniques to be developed, and WordPress needs to stay up to date with these requirements to ensure the best user experience. The future of images in WordPress looks even more compressed.