• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

delete images that have less than 1 view

hshamy

Chevereto Member
hello
i have many images that no one view it ... and many more less than 10 view ... I think it's like thousands images

Is there a way to delete it all in one step ??

I searched in the forum, but I did not find a similar topic ..
may be i using the search box incorrectly. :rolleyes:


thanks
 
There's a hacky way to get rid of images. Simply fill the image_expiration_date column with a past date. On load, Chevereto will remove the expired images.

You only need to update where...views = 0
 
after many Failed attempts i use this SQL query :
UPDATE `chv_images` SET image_expiration_date_gmt='2020-08-26 20:00:00' WHERE image_views=0;

and it work :D
i test it with any Number of views and it also work

thanks Rodolfo
 
can i delete mages with x views between Specific period of time ?
like :
22-8-2020
22-1-2020
what i need to add to that query ??


something else ..
is that query will work with External storage ??

thanks
 
Last edited:
can i delete mages with x views between Specific period of time ?
like :
22-8-2020
22-1-2020
what i need to add to that query ??


something else ..
is that query will work with External storage ??

thanks
Where.. Cond AND anotherCond AND anotherCond...

Simply use AND between multiple conditions.
 
😉 ok i got it ... thanks

and what about is that query will work to delete images frome External storage ? or it need some time to make it done ???
it work with me with normal hosting but i try it with images i have it on External storage but for badly it's still there
 
The image could be cached by the CDN, check the actual file in the server. The deletions and queues tables should contain information about the external storage delete operation.
 
in chv_queues just old 32 images ..it since year ago
in chv_deletions 20000 images was delete ... last of them since many hour ago ... and i was delete images them handly ...
so ... no images delete by query yet from external storage :(

the funy is it work with my test website i just setup to test the query
and when i try to use it with Main website (have external storage) it didnt work o_O:p
 
after many Failed attempts i use this SQL query :
UPDATE `chv_images` SET image_expiration_date_gmt='2020-08-26 20:00:00' WHERE image_views=0;

and it work :D
i test it with any Number of views and it also work

thanks Rodolfo
Can you tell me how to delete images of only guest with 0 or fixed views? And skip check conditions on registered user?
 
Can you tell me how to delete images of only guest with 0 or fixed views? And skip check conditions on registered user?

I apologize to you :( .. unfortunately I do not have much experience .. I was only able to reach this SQL query with Rodolfo help ... i dont know what you need to add more
 
This will set expire to the target date, when image views = 0 and when the image doesn't belong to any user.
SQL:
UPDATE `chv_images` SET image_expiration_date_gmt='2020-09-08 20:50:00' WHERE image_views=0 AND image_user_id IS NULL;

This will set expire to the target date, when image views less than 10 and when the image doesn't belong to any user.
SQL:
UPDATE `chv_images` SET image_expiration_date_gmt='2020-09-08 20:50:00' WHERE image_views<10 AND image_user_id IS NULL;

Got it? Is very easy indeed. If you want to dry run, simply change UPDATE with SELECT * FROM and remove SET image_expiration_date_gmt='2020-09-08 20:50:00'

Hope it helps.
 
Have been using this trick for the past few years and works perfectly. Below is SQL query I am using which specifically target guest images older than one year. So images uploaded recently are not deleted.

SQL:
update chv_images set image_expiration_date_gmt='2020-08-31 00:00:00' WHERE image_date <= '2018-09-01 00:00:00' and image_user_id is NULL and image_views <=100;
 
Back
Top