Images are one of the prominent content forms consumed widely on the internet. Correctly using images on a website is a vast subject and requires great attention to please both the visitors and the search engines. No matter which CMS you’re using to power your website—sooner or later—you’re bound to face few image-related issues (big or small) which may affect your content creation routine. One such issue is related to self-hosted WordPress blogs. It’s the creation of multiple images of different sizes created from the originally uploaded image. Sometimes, bloggers just want to use the original one instead of serving the resized version to the visitors. The following tutorial will help you in disabling the default multiple image-creation behavior of WordPress. If you’re using very large images for your blog posts, I’ll recommend sticking with the default setup. I’ll also advise you to take a backup of your blog before applying the steps mentioned below. Let’s get started to reclaim our originally uploaded images.
If you’re technically challenged and are reluctant to apply the methodologies mentioned below, take help of an expert for the same. Try applying these changes at the weekends.
I personally make sure that I’ve disabled this feature on every new website designed for my clients. I encourage them to use a separate resized and optimized version of an image—wherever required.
Before we start, let’s once quickly go through the reasons for which one may decide to disable this feature. If you’re running your website on a slow and limited-space shared server, the reasons mentioned below are totally justified.
Website owners with extremely huge image archive will find these reasons good enough to go ahead with it. Let’s move on and learn some of the basics related to this subject.
By default, for each of the uploaded image, WordPress generates several copies of the same of varying sizes. These different size copies of the original image may or may not be used within your website layout. Following are the default image sizes created by WordPress.
thumbnail
medium
medium_large
large
full
Apart from these standard and default sizes, a theme or a plugin may generate additional image sizes.
Let’s start with the easiest part! First of all, we’ll disable the default WordPress image sizes from within the dashboard GUI. Here’s how to do it.
Within your WordPress dashboard, go to the Settings → Media → Media Settings → Image sizes option. Here you’ll find all the default WordPress image sizes.
Make sure to click the save button after making the changes. Remember, this action won’t delete the old image copies residing on your web server. In case, you’re using one of the default image sizes on your website, leave its original values—intact.
Another way to disable both the default image sizes and the custom image sizes is through the change of the relevant code. If you’re not comfortable with it, I’ll recommend a plugin for the same.
And, if you’re comfortable with making small code changes, follow this process. The theme file that needs our attention is functions.php
accessible through the Appearance → Editor option.
Within the functions.php
file, look for all the instances of the following two functions.
add_image_size( 'image-size-name', width, height, true [optional parameter] );
set_post_thumbnail_size( width, height );
Delete all the occurrences of both these functions and update the file. Another way to disable all the image sizes except the original uploaded photo is to add the following snippet within your theme’s functions.php
file.
function remove_all_image_sizes() {
foreach ( get_intermediate_image_sizes() as $size ) {
remove_image_size( $size );
}
}
add_action('init', 'remove_all_image_sizes');
Example: And, let’s suppose that apart from the original uploaded image, you also want to keep two image sizes. The medium_large
image and a custom-sized portfolio-avatar
image. Except these 3 image sizes, you want to disable all the other image sizes.
Here’s the snippet to make that happen.
function remove_select_image_sizes() {
foreach ( get_intermediate_image_sizes() as $size ) {
if ( !in_array( $size, array( 'medium_large', 'portfolio-avatar' ) ) ) {
remove_image_size( $size );
}
}
}
add_action('init', 'remove_select_image_sizes');
After disabling the image sizes, use this powerful plugin to remove all the old unused images and to generate the new images sizes—if any. If your image archive is huge, this process may take some time.
Caution: If you’re not sure which image sizes should be disabled, do not go ahead with this process, because it may break your existing design and layout.
I’ll recommend trying it first on a local copy of your website. Once you’re sure everything is working as expected, apply it on your live website. You’ll recover a lot of disk space after disabling the image sizes.
As the year 2025 begins Thailand Begins E-Visa Application For Nigerians on the travel updates…
The good for the people of Rivers State as Governor Sim Fubara Signs 2025 Budget…
On the latest news NNPCL Invites Obasanjo For Tour Of Port Harcourt Refinery according to…
Get to know the Differences Between Lagos And Anambra Lifestyles (Opinion) by African2nice Television as…
Speaking on Tuesday during Channels Television’s End-of-Year Special Review Show, Alausa stated, “President Tinubu has…
President Bola Ahmed Tinubu has vowed that his administration will reduce the prices of food…
This website uses cookies.