{"id":290,"date":"2016-09-13T16:54:18","date_gmt":"2016-09-13T16:54:18","guid":{"rendered":"https:\/\/wiki.samuelchopard.ch\/?p=290"},"modified":"2020-05-03T18:48:37","modified_gmt":"2020-05-03T16:48:37","slug":"change-jpeg-image-compression","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/change-jpeg-image-compression\/","title":{"rendered":"Change JPEG image compression"},"content":{"rendered":"<p><!--more--><\/p>\n<p>Add the following code to the functions.php of your <a target=\"_blank\" href=\"https:\/\/samuelchopard.ch\/wiki\/library\/blank-child-theme\/\" rel=\"noopener noreferrer\" target=\"_blank\">child-theme<\/a>:<\/p>\n<pre class=\"EnlighterJSRAW\">add_filter('jpeg_quality', function($arg){return 100;});\r\nadd_filter( 'wp_editor_set_quality', function($arg){return 100;} );<\/pre>\n<p>When you set the value to 100, it means that WordPress compress the image at its highest quality.<\/p>\n<p>If you want to increase the compression, set the number to 75 or less. (instead of 100)<br \/>\nNote that a smaller value may decrease the image quality.<\/p>\n<p>Sources: <a target=\"_blank\" href=\"http:\/\/www.wpbeginner.com\/wp-tutorials\/how-to-increase-or-decrease-wordpress-jpeg-image-compression\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.wpbeginner.com\/wp-tutorials\/how-to-increase-or-decrease-wordpress-jpeg-image-compression\/<\/a> and <a target=\"_blank\" href=\"https:\/\/fixmywp.com\/blog\/stop-wp-compressing-uploaded-jpeg-images.php\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/fixmywp.com\/blog\/stop-wp-compressing-uploaded-jpeg-images.php<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Add the following code to the functions.php of your child-theme: add_filter('jpeg_quality', function($arg){return 100;}); add_filter( 'wp_editor_set_quality', function($arg){return 100;} ); When you [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[63,136,150,238,273],"class_list":["post-290","post","type-post","status-publish","format-standard","hentry","category-php-tricks","category-wordpress","tag-compression","tag-image","tag-jpeg","tag-quality","tag-size"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":3,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":55121,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/290\/revisions\/55121"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}