Dynamically Resize WordPress Images On-the-Fly

John Turner founder of SeedProd Posted by John Turner on November 15, 2011

Last updated on: September 8, 2012

Creating multiple image sizes in WordPress is quite easy when the image is attached to a post or page. Theme.fm has an excellent write up on how to do this with the add_image_size function. The problem with this method is that it creates a lot of bloat because for every image uploaded it’s sized to this new size even if you’re not going to use it. Also getting the different available sizes from just a url is a pain.

To side step this issue Theme and Plugin developers have resorted to using scripts like TimThumb , which recently have a major vulnerability discovered. Another script that can generate images on the fly is called vt_resized. This script is nice because it uses native WordPress functions to generate the new image. The only is issue is that it does not support WordPress Multisite. Here’s a modified version of the script with crude multisite support.

If you find a bug let me know. Hopefully WordPress will provide a similar function in the WP core in the future.

John Turner founder of SeedProd

By John Turner

John is the founder of SeedProd.com and a WordPress Developer with over 15 years of development experience.

The Best Coming Soon Page and Maintenance Mode Plugin for WordPress

Made with in Charleston, SC USA

LIMITED TIME OFFER - Get access to all of our plugins for use on unlimited sites for just $99  Learn More