{"id":60188,"date":"2021-11-15T19:29:07","date_gmt":"2021-11-15T13:59:07","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=60188"},"modified":"2026-10-06T19:56:49","modified_gmt":"2026-10-06T14:26:49","slug":"wordpress-image-compression","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/","title":{"rendered":"How to Change or Disable Image Compression in WordPress (2026)"},"content":{"rendered":"<p>Uploaded a sharp, high-resolution photo to WordPress, only to find it looks soft or slightly blurry in your post? WordPress image compression is the reason. By default, WordPress re-saves the resized copies of every JPEG you upload at 82% quality, and it also scales down very large images. Here&#8217;s how to change or disable image compression in WordPress in 2026, with copy-ready code, and when you should leave it on.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-60190\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/compress-images.jpg\" alt=\"WordPress image compression settings\" width=\"640\" height=\"426\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/compress-images.jpg 640w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/compress-images-300x200.jpg 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/compress-images-150x100.jpg 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Add <code>add_filter( 'wp_editor_set_quality', function() { return 90; } );<\/code> to your theme&#8217;s functions.php or a code snippets plugin to change WordPress image compression (use 100 to effectively turn it off). New uploads will use the new quality; regenerate thumbnails to update older images.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6aeab50e74fa9\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6aeab50e74fa9\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#How_WordPress_image_compression_works\" >How WordPress image compression works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#How_to_change_WordPress_image_compression\" >How to change WordPress image compression<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Set_a_higher_quality_less_compression\" >Set a higher quality (less compression)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Disable_compression_maximum_quality\" >Disable compression (maximum quality)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Increase_compression_smaller_files\" >Increase compression (smaller files)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Different_quality_for_JPEG_and_WebP\" >Different quality for JPEG and WebP<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Stop_WordPress_scaling_large_images\" >Stop WordPress scaling large images<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Apply_the_new_settings_to_existing_images\" >Apply the new settings to existing images<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Should_you_turn_off_WordPress_image_compression\" >Should you turn off WordPress image compression?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Frequently_asked_questions\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Does_WordPress_compress_images_automatically\" >Does WordPress compress images automatically?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Does_WordPress_compress_the_original_image\" >Does WordPress compress the original image?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/11\/wordpress-image-compression\/#Why_are_my_WordPress_images_blurry\" >Why are my WordPress images blurry?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_WordPress_image_compression_works\"><\/span>How WordPress image compression works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Resized copies are compressed.<\/strong> When you upload a JPEG, WordPress creates thumbnail, medium and large sizes and saves them at quality 82 (on a scale of 0 to 100). Older WordPress versions used 90.<\/li>\n<li><strong>WebP and AVIF too.<\/strong> WordPress also supports WebP and, since version 6.5, AVIF images, and applies a quality setting to their resized copies (WebP defaults to a slightly higher quality than JPEG).<\/li>\n<li><strong>Big images are scaled.<\/strong> Since WordPress 5.3, any image wider or taller than 2,560 pixels is automatically scaled down, and the scaled version is used on your site (the original is kept as a backup).<\/li>\n<li><strong>PNG images<\/strong> are lossless, so WordPress doesn&#8217;t apply a quality setting to them, but PNG files are much bigger.<\/li>\n<\/ul>\n<p>For most blogs the defaults are a good balance between quality and speed. If you run a photography site, sell products with detailed photos or share drone and landscape shots, you may want higher quality.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_change_WordPress_image_compression\"><\/span>How to change WordPress image compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Add one of these snippets to your child theme&#8217;s <em>functions.php<\/em> file or, more safely, with a code snippets plugin so it survives theme updates. The main WordPress hook is <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/wp_editor_set_quality\/\" target=\"_blank\" rel=\"noopener\">wp_editor_set_quality<\/a>, which applies to all image formats. The older <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/jpeg_quality\/\" target=\"_blank\" rel=\"noopener\">jpeg_quality<\/a> hook still works for JPEGs.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Set_a_higher_quality_less_compression\"><\/span>Set a higher quality (less compression)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>add_filter( 'wp_editor_set_quality', function( $quality ) {\r\n    return 90;\r\n} );<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Disable_compression_maximum_quality\"><\/span>Disable compression (maximum quality)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>add_filter( 'wp_editor_set_quality', function( $quality ) {\r\n    return 100;\r\n} );<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Increase_compression_smaller_files\"><\/span>Increase compression (smaller files)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>add_filter( 'wp_editor_set_quality', function( $quality ) {\r\n    return 70;\r\n} );<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Different_quality_for_JPEG_and_WebP\"><\/span>Different quality for JPEG and WebP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code>add_filter( 'wp_editor_set_quality', function( $quality, $mime_type ) {\r\n    if ( 'image\/webp' === $mime_type ) {\r\n        return 80;\r\n    }\r\n    return 90;\r\n}, 10, 2 );<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Stop_WordPress_scaling_large_images\"><\/span>Stop WordPress scaling large images<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To keep images larger than 2,560 pixels at their full size, add:<\/p>\n<pre><code>add_filter( 'big_image_size_threshold', '__return_false' );<\/code><\/pre>\n<p>Or change the limit, for example to 4,000 pixels:<\/p>\n<pre><code>add_filter( 'big_image_size_threshold', function() {\r\n    return 4000;\r\n} );<\/code><\/pre>\n<p>Be careful: very large images can slow your site down and use a lot of storage.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Apply_the_new_settings_to_existing_images\"><\/span>Apply the new settings to existing images<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>These filters only affect images uploaded after you add them. To update older images, use a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/regenerate-thumbnails\/\" target=\"_blank\" rel=\"noopener\">Regenerate Thumbnails<\/a> to recreate all image sizes with the new quality.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Should_you_turn_off_WordPress_image_compression\"><\/span>Should you turn off WordPress image compression?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Compression matters for speed. Large images are often the biggest part of a page and directly affect your <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/05\/core-web-vitals\/\">Core Web Vitals<\/a> and Google rankings. Instead of switching compression off completely, most sites do best with:<\/p>\n<ul>\n<li>A quality of 82 to 90 for JPEGs.<\/li>\n<li>Uploading images at the size you need, not straight from a 50-megapixel camera.<\/li>\n<li>Serving WebP or AVIF images, which are much smaller than JPEG at the same quality.<\/li>\n<li>Avoiding double compression: if you compress images before uploading, or use an image optimisation plugin, raise WordPress&#8217;s own quality so images aren&#8217;t compressed twice.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Does_WordPress_compress_images_automatically\"><\/span>Does WordPress compress images automatically?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. WordPress saves the resized copies of uploaded images at a default quality of 82 for JPEG (slightly higher for WebP), and scales images larger than 2,560 pixels.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_WordPress_compress_the_original_image\"><\/span>Does WordPress compress the original image?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The original file is kept, but if it&#8217;s larger than 2,560 pixels WordPress shows a scaled copy on your site. Smaller originals aren&#8217;t re-compressed, but the thumbnail, medium and large sizes are.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_are_my_WordPress_images_blurry\"><\/span>Why are my WordPress images blurry?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually because WordPress is showing a resized and compressed copy, or a small image size is stretched to fit a wide layout. Raise the quality, upload larger images and choose the &#8220;Full Size&#8221; or &#8220;Large&#8221; size in the editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Uploaded a sharp, high-resolution photo to WordPress, only to find it looks soft or slightly blurry in your post? WordPress&#8230;<\/p>\n","protected":false},"author":4,"featured_media":60190,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-60188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=60188"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60188\/revisions"}],"predecessor-version":[{"id":63310,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/60188\/revisions\/63310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/60190"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=60188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=60188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=60188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}