WordPress tips: how to change the quality of JPEG images after uploading

Source: Internet
Author: User
This may be unfamiliar to everyone. WordPress compresses the image quality by default to 90% after the image is uploaded, the benefits of this operation can greatly speed up page loading and reduce the server space occupied by images. However, some webmasters (including me)

This may be unfamiliar to everyone. WordPress compresses the image quality by default to 90% after the image is uploaded, the benefits of this operation can greatly speed up page loading and reduce the server space occupied by images. However, some webmasters (including me) are still concerned about the compression of the 10%, and still hope that the quality of the 100% original will make me comfortable.

So how can I disable WordPress from automatically compressing and uploading image quality? Insert the following code into your topic functions. php file, and the upload quality will not be compressed in the future.

Add_filter ('jpeg _ quality ', create_function ('', 'Return 100 ;'));

On the other hand, the image compression quality may be higher:

Add_filter ('jpeg _ quality ', create_function ('', 'Return 80 ;'));

Change the parameters following the above code to the compression ratio you like.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.