0

I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images because I have done image responsive solution with my way. So, I don't wanna save any auto generated images from wordpress in my server.

When I google it, most show how to remove from tag at frontend.

1 Answer 1

0

If you mean you want to only save the original image to the server, and not have WP auto-generate additional sizes, there's a function to remove the additional sizes:

<?php
function wpse_remove_image_sizes() {
    // Remove the WP Core "thumbnail" size
    remove_image_size( 'thumbnail' );
    // Remove a custom image size with the slug "custom-size-name"
    remove_image_size( 'custom-size-name' );
    // Add any other sizes you need to remove -
    // this will depend on your theme and plugins.
}
add_action('init', 'wpse_remove_image_sizes');
?>

Proceed with caution, because many themes and some plugins use these other sizes, particularly the thumbnail.

1
  • I only want to remove responsive image that auto generated. I don't want to remove thumbnail, medium, large. And I would never remove those three size because all themes are using one of those size.
    – Por
    May 21, 2020 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.