When you upload an image using the media uploader of your WordPress site, it creates multiple sizes of that image. By default, WordPress creates 4 additional sizes, but your theme and/or plugin(s) may create more sizes of that image. And it’s really a headache when you are considering your storage.
There are 2 ways to stop WordPress from generating multiple image sizes-
1. With Coding: Set a filter to intermediate_image_sizes_advanced
. It returns an array that contains the sizes. Make it return an empty array, and phew! You’re done.
Paste this into the functions.php
file of your theme.
1 2 3 4 5 |
add_filter( 'intermediate_image_sizes_advanced', 'mdc_image_sizes' ); function mdc_image_sizes( $sizes ){ return array(); } |
It’ll stop WP to create additional image sizes and then you’ll have only one copy of the image.
2. Without Coding: Install this plugin- Stop Generating Image Sizes and you are done.
This plugin also allows you to choose which of the sizes you want to be prevented from creating.
WPpeople works mainly on WordPress based projects.
It specializes in developing Plugins, Themes and WP based apps. Well, you can count SEO and maintenance jobs too.
© WPpeople 2021 - Made with &