Images are one of the most vital parts of website optimisation but also most forgotten and hard to control specially when you’re running a multi author site or blogs.
Save Server Space
Uploaded images nowadays are too large, mobile phones taken photos come with 1mb+ and HDR. Most of the WordPress blogs are running on the shared hosting with limited space provided. Even if you are using VPS server, you will always have a file limit uploads. If you’ve uploaded 5mb image and used the medium image size, the original image was kept there unused and useless.
When I was creating a community based website I was surprised how big the photos they’ve uploaded when creating a blog post! That’s when I came across with a solution via post on stackoverflow : Automatically replace original uploaded image with large image size . A really life-saver code but need to be modified to work on the latest WordPress version. Below is the modified and perfectly working snippet 🙂
Since you can set the large image size, if you call the_post_thumbnail(‘full’) function, it will display the large image size instead of the original one! Say goodbye to slow loading featured images thus result to positive site optimisation. Feel free to check on gtmetrix or pingdom and be amazed with the results.
Bonus Image Optimization Tips
Using this snippet side by side with EWWW Image Optimizer gives me faster post and pages loading I can’t imagine possible even without caching plugin. Then what happened when I’ve added one was perfect! Fast loading and minimum space on the server really helps a lot, that’s why I’ve created this post and help everyone else too.
If you have any additional tips, feel free to use the comment section. Who knows, you might probably save a person out there 🙂