• Hi, thanks for webp converter, its simple and in manu sites workin…. Can y pls add option – delete original image after conversion and other dimensions was greated,,,,? Or in which file/line I can add deletion my self

    thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter yessoftmk

    (@yessoftmk)

    any idea?

    I try by custom code:

    add_filter( 'wp_generate_attachment_metadata', 'delete_fullsize_image' );
    function delete_fullsize_image( $metadata )
    {
        $upload_dir = wp_upload_dir();
        $full_image_path = trailingslashit( $upload_dir['basedir'] ) . $metadata['file'];
        $deleted = unlink( $full_image_path );
    
        return $metadata;
    }

    but not workin…. I guess it’s because of your plugin conflict

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for reaching out @yessoftmk. As long as you don’t have the option to keep “Output JPEG images in addition to the modern format enabled, only the original image uploaded will be kept. This image will only be visible from your hosting file manage or FTP, with WordPress and your media manage using the newer WebP or AVIF format.

    While there is no filter or feature to to remove the original image, as it’s used as a fallback, you can remove the most recent JPEG images using FTP and remove them there if you wish. As they are used as a fallback, it may be worthwhile storing them locally as opposed to deleting them alone to free up hosting storage space. ie. It may not be a good idea to completely remove the original JPEG image.

    Feel free to also add a feature request to the plugins GitHub repository if you wish, or if you’re uncomfortable doing so I can create one on your behalf regarding the possibility of not including the original JPEG image when uploading.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.