X

Remove Unneeded Images / Thumbnail Sizes

Snippets by IsItWP

WordPress has many default image sizes. When you upload an image on your website, it creates all the image sizes for your new upload and take more space on the server. Few of the default image sizes are unnecessary and they may also confuse your media configurations. It’s better to remove these image sizes permanently.

Instructions: Add the following code to the functions.php file of your WordPress theme.

    update_option( 'thumbnail_size_h', 0 );
    update_option( 'thumbnail_size_w', 0 );
    update_option( 'medium_size_h', 0 );
    update_option( 'medium_size_w', 0 );
    update_option( 'large_size_h', 0 );
    update_option( 'large_size_w', 0 );

You may also enjoy removing featured image meta box in WordPress.

Comments   Leave a Reply

  1. 25 WordPress Code Snippets for Enhanced Performance - ManageWP May 27, 2014 at 11:42 am

    […] Source […]

  2. Andrew Leach May 7, 2012 at 6:23 pm

    Sounds like this is a good way of saving space on your server.  Thanks for sharing.

  3. Elliott the web design guy May 4, 2012 at 7:13 pm

    eh? this does what exactly? Does this mean no need for thumbnail regen?

    1.  Hi Elliott no this simply removes the default image sizes from being created.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!