Get All Image Sizes in WordPress – Intermediate image sizes

How to get additional image size in wordpress to develop your website proper without any disk usage. Learn how to remove additional image sizes in wordpress.

WordPress allows you to define your own image sizes in order to decorate your website. WP automatically generates some image sizes having aliases (thumbnail, medium, large). You can prevent those Image sizes in wordpress. Learn how to get all image sizes in wordpress. Most of the users ask the question regarding get intermediate image sizes in wordpress.

Get Intermediate Image Sizes:

Plugins & themes create image sizes in order to adjust the layout. Defining extra image sizes can lead you to consume hosting space as well as data increment. Stop creating wordpress extra images and save web space easily.

Additional Image sizes wordpress:

global $_wp_additional_image_sizes; 
print '<pre>'; 
    print_r($_wp_additional_image_sizes); 
print '</pre>';

 

Intermediate Image Size Trick:

$_wp_additional_image_sizes stop works due to complexity of the theme. Overcome the problem of  no results paste the below code in your function.php and override the theme behavior to get image sizes. We execute the code on wordpress INIT and get theme declared images.

add_action('init', 'get_all_image_sizes');

function get_all_image_sizes(){
      global $_wp_additional_image_sizes; 
      print '<pre>'; 
           print_r( $_wp_additional_image_sizes ); 
      print '</pre>';
}

Suppose it returns

Array
(

[medium-block] => Array
(
[width] => 300
[height] => 200
[crop] =>
)

)

Your target is to remove the bold image sizes learn how to remove below.


Remove Theme image sizes in WordPress:

Theme image size consume space of your web host and let you drain your money. How to remove additional image sizes to save additional hosting space.

add_action('init', 'twoclock_remove_image_size');

function twoclock_remove_image_size() {
      //removing image size wordpress
      remove_image_size('medium-block');
 }

That’s how you can remove different image sizes from your wordpress theme helps you in saving your load time and optimize your disk by save disk quota.

Leave a Reply

Your email address will not be published. Required fields are marked *