How to Prevent compressing images in WordPress

One of the WordPress features is compressing photos when uploading. When you upload a photo to the site through the media section of WordPress to use it on site content, a 5% reduction in the size of the photo will be reduced by WordPress.

In this session of WordPress tutorials we will avoid blocking images in WordPress.

Of course, in WordPress version 4.3, this has been reduced to 5% to improve image resolution, but still the size of photos is so high that if you use photos on the site you will definitely notice this. Was.

We recommend that if you are looking for better ways to reduce the size of your used photos, the tinypng plugin is a great option to reduce the size of your photos without compromising quality.

How to Prevent Compressing Images in WordPress

You can use plugins to prevent images from being jammed in WordPress,

but we always advise webmasters not to use the plugin as much as possible,

which will increase the security of your WordPress site and increase the security of your site.

The best way to use php code is to simply enter your site’s template folder through your site’s control panel then open the functions.php file.

Back up this file before making any changes to this file so that you can restore the site if you have problems.

Now paste the following code before tag?>.

add_filter (‘jpeg_quality’, function ($ arg) {return 100;});

You can change the amount of image compression in WordPress depending on your needs,

in the code above we’ve put a number of 4 to actually prevent images from being compressed in WordPress.

Note that image reductions are one of the key elements of a SEO site to keep in mind,

so I recommend reading the SEO WordPress tutorial before closing this page to get familiar with professional SEO techniques.

How helpful was the training for you?

Leave a Reply

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