Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress JPEG Görüntü Sıkıştırma Nasıl Değiştirilir

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

Geçtiğimiz günlerde okuyucularımızdan biri WordPress’te görüntü sıkıştırma ayarını değiştirmenin mümkün olup olmadığını sordu.

WordPress, daha iyi performans için varsayılan olarak resimlerinizi sıkıştırır. Ancak, bu biraz daha düşük kaliteyle sonuçlanacaktır.

Bu makalede, WordPress’te JPEG görüntü sıkıştırmasını nasıl artıracağınızı veya azaltacağınızı göstereceğiz.

WordPress JPEG Görüntü Sıkıştırmasını Neden Değiştirelim?

WordPress web sitenize her JPEG görüntü yüklediğinizde, otomatik olarak görüntüyü %90 kaliteye sıkıştırır. WordPress 4.5‘te, mobil kullanıcılar için site performansını iyileştirmek amacıyla bu sayı %82’ye düşürülmüştü.

Web sitenizde yüksek kaliteli görüntüler sergilemek isteyen bir fotoğrafçıysanız, WordPress’te görüntü sıkıştırmayı kapatabilirsiniz.

WordPress’te Görüntü Sıkıştırma Nasıl Devre Dışı Bırakılır

Tek yapmanız gereken aşağıdaki kodu temanızın functions.php dosyasına manuel olarak veya WPCode gibi bir kod parçacığı eklentisi kullanarak (önerilir) yapıştırmaktır.

Bunu daha önce yapmadıysanız, WordPress web sitenize nasıl özel kod ekleyeceğinize ilişkin kılavuzumuzu görmek isteyebilirsiniz.

İlk olarak, WPCode Free Plugin eklentisini yüklemeniz gerekir. Daha fazla ayrıntı için, WordPress eklentisinin nasıl kurulacağına ilişkin adım adım kılavuzumuza bakın.

Etkinleştirmenin ardından, WordPress kontrol panelinizde Kod Parçacıkları ” + Parçacık Ekle bölümüne gitmeniz gerekir. Bundan sonra, farenizi ‘Özel Kod Ekle’ şablonunun üzerine getirmeli ve ardından ‘Snippet Kullan’ düğmesine tıklamalısınız.

Adding a New Snippet in WPCode

Bu sizi özel snippet’inizi oluşturabileceğiniz yeni bir ekrana götürecektir. Snippet’e ‘WordPress’te Görüntü Sıkıştırmayı Devre Dışı Bırak’ gibi bir başlık eklemeniz gerekir.

Bundan sonra, Kod Türü açılır menüsünden ‘PHP Snippet’i seçmeli ve ardından aşağıdaki kod parçacığını ‘Kod Önizleme’ bölmesine yapıştırmalısınız.

add_filter('jpeg_quality', function($arg){return 100;});
Disabling Image Compression Using WPCode

Değeri 100 olarak ayarladığınızda, WordPress görüntüyü en yüksek kalitede sıkıştıracaktır.

Son olarak, ekranın üst kısmındaki ‘Etkin Değil’den ‘Etkin’e geçiş anahtarını tıklamanız ve ardından ‘Snippet’i Kaydet’ düğmesini tıklamanız gerekir.

Tebrikler, WordPress sitenizde JPEG sıkıştırmayı devre dışı bıraktınız.

Eğer bir fotoğrafçı veya sanatçı değilseniz, muhtemelen kalite açısından pek bir fark görmezsiniz. Ancak günlük olarak yüksek kaliteli görüntülerle çalışanlar için kalite farkı açıktır.

WordPress’te Görüntü Sıkıştırma Nasıl Artırılır

Sıkıştırma kalitesini olduğu gibi bırakmanın kesinlikle performans avantajları vardır. Ancak isterseniz, resimlerinizi daha fazla sıkıştırmak ve biraz yer kazanmak için sayıyı 100’den 80’e veya daha düşük bir değere değiştirebilirsiniz.

Önceki yöntemde yaptığınız gibi yeni bir WPCode snippet’i oluşturun ve ardından aşağıdaki kodu yapıştırın:

add_filter('jpeg_quality', function($arg){return 75;});
Increasing Image Compression Using WPCode

Parçacığı etkin hale getirip kaydettiğinizde, JPEG resimleriniz daha küçük dosya boyutlarına sıkıştırılacaktır. Görüntüler daha düşük kalitede görünecek, ancak web sunucunuzda yer kazanacaksınız.

İpucu: Bu görüntü kalitesi değişikliklerini yaptığınızda, küçük resimlerinizi yeniden oluşturduğunuzdan da emin olmak istersiniz.

Umarız bu makale WordPress’te JPEG görüntü sıkıştırmasını nasıl değiştireceğinizi öğrenmenize yardımcı olmuştur. WordPress’te nasıl iletişim formu oluşturacağınıza dair rehberimizi veya en iyi Instagram WordPress eklentileri uzman seçimimizi de görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

51 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Tom says

    I tried this so many times, and many different variations of this code but it never works. I don’t know what else to do. Every time I upload a photo, I can see that the quality is blurrier. Do you have any other tips?

  3. Purnendu Mukherjee says

    Hi,
    If we use a image compression plugin like Smush, Optiomole or any other, will my images be compressed twice (once by WordPress and then by the plugin)??

    • WPBeginner Support says

      You would want to check with the support for the plugin you plan to use but most should have the ability to cancel the standard compression.

      Yönetici

  4. Rigsby says

    Hello, once the php is added, will that override any image compression plugin that is installed at a later date or does the plugin override the code? It will be hard to remember that your php was once added a long time ago, and therefore it may cause headaches wondering why the plugin isn’t working correctly.

    Thanks : )

  5. Tom says

    ” If you want, you can change the number from 100 to 80 or something lower… then all you have to do is paste the following code:”

    ADD THE CODE WHERE???

  6. rob says

    Hi – Do images need to be reuploaded for it to take effect?
    Also, will this work for png images or do I need to change jpeg to png in the php code?
    Thanks

    • WPBeginner Support says

      This would only apply to new images and not your current images and you do not have to worry about PNG compression.

      Yönetici

  7. puspa chaulagai says

    hey, I am from love and fun quotes I found your article while I searching for how to stop auto compressing images on WordPress. I try your code but it still not working. When I change the theme it’s work but in which theme I apply it doesn’t work. How to remove auto image compress by theme please help.

    • WPBeginner Support says

      You would want to reach out to the support for your specific theme for them to be able to assist with their specific compression.

      Yönetici

  8. Heather Wilson says

    Hello,

    I am working with wordpress.com – can you do this through the customizing CSS menu, and if so how? I am brand new to coding.

  9. Karlo Gavric says

    Even I change compression to 100, my images looks so bad in quality, only if I use full sized (widht 1300+px) is OK, but if I use Large file which is 900px, it is horrible.

    I added code to change compression in functions.php, contacted my theme supplier and hosting support, they don’t have any compressions turned on.

    Any ideas?

      • Karlo Gavric says

        Hi,

        I’ve tried it, but the problem still persists. Tried also just changing a theme with plugins enabled / disabled, no change (?! feeling confused really ?!)

        • nospampls says

          you need to set your large file size to a higher image size. wordpress will automatically crop your images…

  10. Anne says

    what does this mean

    Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

    Thank you

    • Eoin says

      It means that you need to use an external editor to edit the files because the WordPress editor is restricted.. There are plugins available for editing theme files through the wordpress admin which you can look up on the Add New Plugin page, otherwize, you need to download your theme files using a FTP software, update the functions.php file and upload it back to the theme folder on the server. If you are not sure about FTP, I would just look for an theme editor plugin so you can do it in the wordpress admin, but make sure to deactivate the plugin when you are finished to prevent any security issues.

  11. Devi Chand says

    Hi,

    My product images looked blurred because they are already optimised and wordpress was optimising them again (I believe). I used the above code and also regenerated the thumbnails. Initially, I could not find the changes. However, later the images started showing up the way I wanted (not blurred, perfect) for some time. But I check again and the images are all looking blurred again. Can you help?

  12. Bjornen says

    Hi!

    So, is there a solution to having WP not up-scaling the image size (kb/mb) when uploading via “Media” in WordPress?

    Meaning; I want WP to scale the picture into thumb nail, medium and large and to keep the original as it does per default, but NOT to up-scale the thumb ail, medium or large file sizes?

    Thanks!

  13. Mike says

    I added this code exactly how you showed it and now it won’t let me upload photos an error message keeps coming up. please help! Thanks!

  14. Mélanie says

    Hi, I use this code and regenerated all my images, but unfortunatly, the size of my image is the same. I use enfold theme and my WP version is 4.7.2. Did I miss a step?

  15. Alessandro says

    Hi, I have added the code as showed in the video but, nothing, WordPress keeps reducing the size of my images.

    Any other option?

    Thanks for your support
    Alessandro

  16. Lukas Priyambodo says

    Quality 100 doesn’t always mean highest quality, because of JPEG algorithm and what kind of content of the image. Using SSIM, I sometimes found that quality 95 has better score than quality 100 or at least quality 95 has better filesize trade off compare to quality 100.

  17. Jaime says

    Hi there. Are you able to disable image compression if you have a free WordPress account? If so, where do I find my function’s php file?

  18. M.Mairaj says

    Thanks for sharing such a fantastic post about image Compression in WordPress. All the tips are really very very worthwhile.

    Keep sharing :)

    Regards

    Mairaj

  19. Peter says

    Don’t follow this advice! I added this line of code in my functions.php file and now I get this message when loading my website!

    Parse error: syntax error, unexpected T_STRING in /home/sittin11/public_html/wp-content/themes/Divi/core/functions.php on line 44

  20. karl says

    Let’s clear up some things.
    1 – WP does not mess with your original uploaded file. The compression levels discussed are for WP generated images – the TN, Med, Large in your WP media settings.

    2 – if you change the compression settings, WP does not reprocess all your current uploads. That’s why you run Regenerate Thumbnails.

    3 – I will challenge any photographer to see the quality difference between 100 and 90 in a JPG. In rare cases, you may. But for 99% of images you’ll never tell.

    4 – Depending on your theme and your media settings, yes, some smaller image sizes will be cropped from your orignal upload. It’s the nature of the beast. If your TN is square and you upload a horizontal phjoto, of course it will be cropped. Cropping your images BEFORE uploading – and using a proportion compatible with your theme layout – will net you fewer issues.

  21. Dave Porter says

    Thanks for the article, very useful to know.

    I’m interested in the comment about ‘make sure you regenerate your thumbnails’

    If an image is uploaded at say 82%, regenerating the thumbnails does what?

    And I assume that after changing the percentage, this is only going to be for new images?
    I would guess any existing images would remain at the same quality, or does WordPress keep a copy of the original uploaded?
    TIA, Dave

  22. Michael says

    Is it possible to disable image compression in WordPress?
    The article has a headline saying so, but then it describes it as “least compression”, that is not disabling compression…just wondering it is possible to disable compression for uploaded pictures…

  23. Thomas says

    Great Tips, thank you.
    I have one more question: If I upload images to WP that are already compressed (say to 90%) – will they be compressed again (82% of 90% = 74.8%)?

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.