Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Resize Original Images WordPress


Wordpress not resizing original images. I want a simple code that resize original images at upload. Dont need to have options page or something.

Max Width: 1024
Max Height: 800

You can check some plugins doing similar this:

I want a simplified code without options page and using wordpress's own image resizing system.

Answers (7)


Victor Teixeira answers:

Hi, just use the 'auto image resizer plugin'. It will automatically resize all your uploaded images to the 'large' image size set in the media preferences and will delete the original image thus this will became the full image and will save a lot of space on your host.

But if you don't want to set the images to the 'large' image size and you still want your users to be able to configure the sizes on the media settings you can edit the plugin on line 36 as shown bellow:

//$width = get_option('large_size_w'); // instead of this
//$height = get_option('large_size_h'); // use this:
$width = 1024;
$height = 800;

That's it.


Adam W. Warner answers:

Why not go to Settings-->Media and set the size you want for one of the default sizes? Read here for further explanation:
[[LINK href=""]][[/LINK]]

Or did I not understand your question correctly?


Denzel Chia answers:


You can use Tim thumb.

here is the script

After you have uploaded the script, use the following html to auto resize the image.

HTML example:

<img src="" alt="" />

This script was originally written by Darren Hoyt, one of the owner of WP Questions.



flashingcursor answers:

If you're using WP 3.0 there are a couple of ways you can accomplish what you'd like to do.

First of all, you can set your default image sizes in Settings->Media

If you need more image size options, you can create as many as you'd like by adding a few lines to your themes functions.php file.

add_image_size('Slideshow', 500, 260, TRUE);
add_image_size('Mini', 90, 90, TRUE);

These can be adjusted to your needs and then called from within your theme using the following code:

the_post_thumbnail('Slideshow'); // will display the 500x260 image
the_post_thumbnail('Mini'); // will display the 90x90 image

Finally, if you already have a lot of posts with images, once you've added the code above, you can use the Regenerate Thumbnails plugin:


Jeremy Jared answers:

I would recommend installing the nextGen Gallery plug-in. It is in my opinion the only way to handle images using Wordpress. You can set it to resize images at upload, set thumbnail sizes, organize images by gallery or insert single images inside of the text editor. NextGen gallery also has several add-ons which can be found at the plug-in download page.
Here is the link:


Duncan O'Neill answers:

First, you need to make sure that post thumbnail support is enabled for your theme;

In the functions.php file;

add_theme_support( 'post-thumbnails' );

//Then set your sizes

set_post_thumbnail_size(150,100,true); // or whatever size for small default images


Then to call it within the loop;

if (has_post_thumbnail){


Use the featured image utility in your posts to upload new images.

Reference : Justin Tadlock's Everything YOu need to know about WP 2.9's post image feature;


David answers:

I would go with the previous answers by Duncan O'Neill on setting your image sizes

and then If I understand your question correctly this plugin will help to resize all existing images to the sizes that you setup

<a href="">regenerate-thumbnails</a>

√únsal Korkmaz comments:

i dont understand why ppl not reading question.
I dont want other image size that creating. I want to resize original image to Max Width: 1024, Max Height: 800 I gave you sample addons that doing it, i just want simplified code that i can use in mu-plugins without options.

David comments:

This is the first time you reveal that you would like to use this in a mu environment.
Also what you are asking is not really possible in a simplified code...

This may work....
set your image sizes under media settings as per normal and then use the plugin that I suggested this will resize all of the existing photos to the correct sizes that you have set under media.

Depending on how may sites you have setup, this may place quite a strain on the server...