Do you want to remove WordPress default image sizes? If you are looking for a simple guide, keep reading this article.
When you upload an image to a WordPress site, the server automatically converts it to different image sizes. By default, WordPress is configured with three custom image dimensions. This means that after uploading an image, WordPress automatically creates copies of it in different sizes.
However, this isn’t always necessary and can take up space on your server. In this guide, we’ll show you 2 methods to remove WordPress’s default image sizes from your site.
Table of contents
Why Remove Default Image Sizes in WordPress?
By default, when you upload images to WordPress, the server generates copies of them in 3 different sizes:
- Thumbnail – 150 x 150 pixels
- Medium – 300 x 300 pixels
- Large – 1024 x 1024 pixels
Even though this can be useful, it also takes up space in your server. So, if you don’t need so many image sizes, it’s a good idea to disable them on your site. For example, if you aren’t going to use the medium-sized image on your site, you can remove it and stop generating image copies of that size.
How to Disable WordPress Default Image Sizes
Here, we’ll show you 2 beginner-friendly methods to disable default image sizes in WordPress.
- Manually via WP-Admin
- Programmatically via coding
They’re both simple and effective, so choose the one that best suits your skills.
NOTE: Before removing the default image sizes, make sure that you are not using the sizes you’re going to disable on your site. Remember to check blog posts, featured images, and so on.
1) Manually via WP-Admin
This is the simplest way to remove default image sizes from WordPress. With a few mouse clicks, you can disable the image sizes you don’t need on your site.
The first thing you need to do is log in to your website and go to the Media Settings.

There, you will see the three default sizes we mentioned above (thumbnail, medium, large) and their dimensions. To remove them, set the values to 0 and update the settings.

Once you hit the Save button, you are good to go. From now on, when you upload new images to your server, it won’t create copies of the image sizes you just disabled.
You can do this for all three default sizes or specific ones. Keep in mind that if you set all the values to 0, you will only save the original image.
2) Programmatically (Coding)
If you have coding skills, we have another solution for you. In this section, we will show you a snippet that lets you remove the default image sizes in WordPress.
Since you will need to edit your theme’s functions.php file, we recommend using a child theme. If you don’t have one, you can either create one following this step-by-step guide or use a plugin to generate a child theme in a couple of clicks. Additionally, we recommend you generate a complete backup of your site for security reasons.
To edit the functions.php, you can use the Theme Editor in your WordPress dashboard or a plugin. For this demo, we will use a free plugin called Code Snippets. This tool works as a site-specific plugin and lets you add custom PHP, HTML, JavaScript, and CSS to your site without editing the theme’s files.
Remove All Default Image Sizes
To remove all WordPress default image sizes via coding, first, install and activate the Code Snippets plugin. After that, go to Settings.

Click the Add New button, and you will see an editor where you can add custom code.

To do this, first name your snippet. Then, copy the code from below and paste it into the editor.
add_filter( 'intermediate_image_sizes_advanced', 'prefix_remove_default_images' );
// This will remove the default image sizes and the medium_large size.
function prefix_remove_default_images( $sizes ) {
unset( $sizes['small']); // 150px
unset( $sizes['medium']); // 300px
unset( $sizes['large']); // 1024px
unset( $sizes['medium_large']); // 768px
return $sizes;
}

After that, press Save and activate.
You have successfully removed all the image sizes mentioned in the code from your server. If you take a closer look at the snippet, you can see that you have disabled four image sizes.
- Small
- Medium
- Large
- Medium_large

The first three are the default image sizes in WordPress. However, some themes and plugins may also register custom images, so in this example, we’ve disabled the medium_large images.
Remove Specific Default Image Sizes
Now, let’s say you only want to disable the medium and large image sizes. The code would be something like this:
add_filter( 'intermediate_image_sizes_advanced', 'prefix_remove_default_images' );
// This will remove the default image sizes medium and large.
function prefix_remove_default_images( $sizes ) {
unset( $sizes['medium']); // 300px
unset( $sizes['large']); // 1024px
return $sizes;
}
As you can see, the code is straightforward to edit, so you can customize it and remove the default image sizes you don’t need.
How to Remove WordPress Default Image Sizes from Existing Images
It’s important to note that when you disable the default image sizes in WordPress, whether in the WP-admin or via code, the old images remain on your server. You’re not deleting those image sizes, but you’re preventing WordPress from generating copies of them.
However, you can manually remove the default image sizes from existing files. To do this, check out our guide on removing thumbnails from WordPress.
Bonus: Add and Change Custom Image Sizes in WordPress
What if you want to add or change customized image sizes on your site instead of removing them? You can do that manually or with plugins. For more information, check out our guide on adding and changing image sizes in WordPress.
Tips and Best Practices
- Identify unused sizes first – Check your theme and plugins to see which image sizes are actually being used before removing any.
- Use a staging site – Always test changes on a staging environment to avoid breaking layouts or image display on your live site.
- Keep at least one large and one thumbnail size – These are often required by WordPress and themes for featured images and galleries.
- Use a regeneration plugin carefully – When regenerating or deleting thumbnails, back up your media library to prevent data loss.
- Optimize uploads after removal – Combine this step with image optimization tools to save even more storage and improve performance.
- Document your changes – Note which image sizes you’ve removed so you can restore them easily in the future if needed.
- Review after theme or plugin updates – Updates may reintroduce new image sizes, so recheck your settings periodically.
Frequently Asked Questions
Now, let’s take a look at some of the frequently asked questions and answers regarding this topic.
By default, WordPress generates three image sizes: thumbnail, medium, and large. However, themes and plugins can register additional custom sizes.
Yes, but it’s not recommended to disable all of them. You can remove unnecessary ones using filters or by setting their width and height to zero in the Media settings.
Disabling image size generation doesn’t delete existing files. You’ll need to use a plugin like Regenerate Thumbnails to remove or recreate them.
If your theme relies on specific image sizes, removing them might cause layout issues. Always test on a staging site before applying changes.
Yes, plugins like Stop Generating Unnecessary Thumbnails or Media Cleaner help manage, disable, or delete extra image sizes without coding.
Absolutely. You can re-add default or custom image sizes anytime using functions like add_image_size() in your theme’s functions.php file.
Yes. Reducing automatically generated images saves disk space and can slightly speed up media uploads, especially on image-heavy websites.
Conclusion
All in all, keeping image sizes you don’t need isn’t a good idea because they take up space on your server. We recommend you remove default image sizes in WordPress to optimize your media library.
There are two ways to do that:
- From the WP-Admin
- Via coding
Both methods are easy and effective. If you don’t have coding skills, you can edit the default image sizes from the Media Settings page and disable the ones you don’t need in a few clicks. On the other hand, if you prefer to build your solution, you can use and adapt the PHP script. Finally, before changing the functions.php file, remember to use a child theme or a site-specific WordPress plugin.
We hope you have enjoyed this article and found it helpful. If you did, please share it on social media!
Which method do you prefer to disable the default image sizes?
Do you know of any others?
Let us know in the comments below.

7 comments
Waleed Kh
The code doesn’t do anything. I added it in function.php, all sizes still exist.
add_filter(‘intermediate_image_sizes_advanced’, ‘prefix_remove_default_images’);
function prefix_remove_default_images($sizes)
{
unset($sizes[‘1536×1536’]);
unset($sizes[‘2048×2048’]);
unset($sizes[‘medium_large’]); // 768px
unset($sizes[‘woocommerce_single’]); //500
unset($sizes[‘woocommerce_gallery_thumbnail’]); //100
unset($sizes[‘woocommerce_thumbnail’]); //300
return $sizes;
}
Angelo
No way, I can’t remove the images automatically generated from media library uploads. I also set as 0 all the values into the Settings > Media > Image sizes but they’re still generating…
Jane
Hello Angelo.
Have you tried the plugin method?
Zain Waheed
This really helped me. Thanks For this article.
german
Thanks Zain
Priya Sharma
Hello, I got to learn many new things from this article about wordpress image sizes. I got all the beneficial information which I was looking for. Thank for presenting enlightening article.
german
Thanks Priya 🙂