Forum Replies Created

Viewing 1 replies (of 1 total)
  • I needed to delete all uploaded images after 30 days, because we’ve deleted any entries long before then, and need to reclaim space from the leftover uploaded files. I created a cron job which deletes all files in the WPForms uploads directory which have certain file extensions, and are older than 30 days. I highly recommend testing this command from a shell first, to make sure it matches your intended files and does not match others. You can remove the -delete commend just to list which files it matches. Note this command will delete all files older than 30 days, even if you have not deleted the form entry yet.

    find ~/public_html/wp-content/uploads/wpforms -mtime +30 -type f \( -name \*.jpeg -o -name \*.jpg -o -name \*.png -o -name \*.gif \) -delete

    • This reply was modified 4 years, 6 months ago by pacmanfan.
Viewing 1 replies (of 1 total)