Divi is popular WordPress theme. If you are using Divi theme then you have noticed it generates some images automatically for blog, portfolio and gallery. Sometimes that is not needed based on our requirements. Now you can easily remove extra image sizes in Divi theme by using below function. It will save space of unnecessary images on your server. Add below function to your Divi or Child Theme’s functions.php


add_action('intermediate_image_sizes_advanced', 'cp_remove_extra_image_sizes');
function cp_remove_extra_image_sizes( $sizes ) {
    unset( $sizes['et-pb-post-main-image'] );
    unset( $sizes['et-pb-portfolio-image'] );
    unset( $sizes['et-pb-portfolio-module-image'] );
    unset( $sizes['et-pb-portfolio-image-single'] );
    unset( $sizes['et-pb-gallery-module-image-portrait'] );
    unset( $sizes['et-pb-gallery-module-image-portrait'] );
    unset( $sizes['et-pb-gallery-module-image-portrait'] );
    return $sizes;

Add a new comment

Your email address will not be published.