• Resolved Martin Taylor

    (@docdunning)


    When I delete an image from the media library, the WebP versions created by LiteSpeed are not deleted, but remain in the uploads directory.

    This gives me a problem if I now upload a new version of the image that I deleted. Because there are still related images in the uploads folder, WP renames my new image file with a “-1” suffix.

    Say my image is named xxxxx.png, then it will be named xxxxx-1.png.

    This causes issues for our theme files, which expect to find the original name xxxxx.png.

    What do I need to do, to remove the WebP versions of the deleted image, before uploading a new one?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support qtwrk

    (@qtwrk)

    I can not reproduce it on my test site , perhaps some other plugin interfered

    could you please try this on a clean WP , see if this still happen ?

    Thread Starter Martin Taylor

    (@docdunning)

    Thanks for replying, @qtwrk.

    Just to be clear, the steps I follow are:

    • Upload an image to the media library – say xxxxx.png
    • After a while, LiteSpeed creates xxxxx.png.webp in the uploads folder. Actually I don’t know how long this takes, but I guess it depends on a cron. When I look at the media library, I see over to the right that there is a webp version.
    • Now I delete the media item
    • I upload the same media item again
    • This time, WP changes the uploaded filename to xxxxx-1.png. I think this is because WP has found the webp version still in the uploads folder, so it is trying to avoid a naming clash

    Right now in my test, LiteSpeed has not created the webp version, so I cannot yet complete the test. I’ll report back when the webp version has been created.

    Plugin Support qtwrk

    (@qtwrk)

    I got a feeling it’s wp database residual , could you please try the same process, but without LSCWP enabled at all ?

    Thread Starter Martin Taylor

    (@docdunning)

    @qtwrk

    I only have LiteSpeed enabled on our production site, and I can’t disable it there. When I install LS on a local test site, it isn’t connected to QUIC.cloud, so I don’t get the WebP versions or optimised JPG added. So it’s really difficult to do a meaningful test.

    Anyway, I just went through the whole cycle again, and this time it worked OK. When I deleted the media item, the upload directory and database were completely cleared of all related records and files. I got an LS message at the top of the media library “Reset the optimised data successfully.”

    And now when I add the same image again, it doesn’t get the ‘-1’ suffix ??

    So – this is good news. We know that it does work, even though something went wrong that previous time.

    I’ll leave it for now as fixed, although nothing was changed, so I’ll just have to keep an eye on it. Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WebP images still exist after deleting media’ is closed to new replies.