WordPress Accelerated Website Images to webp format

Many times, our WordPress open speed is very slow, is due to too many pictures in the web page, the server's bandwidth itself is not enough to cause this situation, and then a check, the web page in the picture is too big, each picture is a large hundreds of K, or even 1-2M, open the web page to the site to load these pictures, greatly reducing the web page to open the speed, so at this time we choose to optimize the picture to Reduce the size of the picture way to speed up the website.

图片[1]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Here we are going to introduce a new image format, the webp format.

WebP is a modern image format developed by GoogleIt is designed to provide smaller file sizes and higher image quality. It supports both lossy and lossless compression techniques while allowing transparency and animation. Compared to traditional JPEG and PNG formats, WebP can significantly reduce file size while maintaining image quality.

So the advantage of webp is that it doesn't compromise the quality of the image, but the image size is smaller.

Next, we'll explain how to convert all the images on your website to webp format.

1, first of all, we will be in the site directory of all the picture attachments into webp format, in the background to find Images to Webp plug-in, and install the

图片[2]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Plugin installed We then add the corresponding code in accordance with the instructions of the plugin, after the enable, otherwise the enable will report an error.

2, add the code needed for the plugin:

图片[3]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复
图片[4]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

First code:

map $arg_no_webp $no_webp{
    default "";
    "1" "no_webp".
}

map $http_accept $webp_suffix{
    default "";
    "~*webp" ".webp"; }
}

After adding the first piece of code, restart Nginx.

图片[5]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Next, open the site's configuration and add another piece of code.

图片[6]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Second code:

location ~* ^/. +\. (png|gif|jpe?g)$ {
    add_header Vary Accept.
    try_files $uri$webp_suffix$no_webp $uri =404;
}

At this point, the plug-in required code, all added to complete, and then we return to the website background plug-in management, start Images to Webp plug-in.

图片[7]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Wait for the prompt to complete (if you site more pictures, please wait patiently, the conversion takes time, may be more than ten minutes, or 1-2 hours), so far, all the pictures of your site into webp format, the picture volume is smaller.

Here we open the site to test, the effect (open the page press F12, select Network, you can see):

图片[8]-WordPress加速网站  图片转webp格式-光子波动网 | WordPress教程、Elementor教程与故障修复

Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Jack
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments