1. Home
  2. Knowledge Base
  3. Beginner's Corner
  4. General
  5. Delete files when deleting Downloads

Delete files when deleting Downloads

Starting with our 4.7.71 version, you will be able to delete a file and remove it from the Media Library when you remove an old version from a download or delete the download you created.

Default functionality will be set to off, meaning that users need to hook to this filter, dlm_delete_files, for the functionality to work. Adding add_filter( 'dlm_delete_files', '__return_true' ); in your active theme or child theme’s functions.php will enable this new behaviour.

It will go like this:

  • From the Downloads table list, (permanently) deleting a Download will delete all files and their associated versions
  • When editing a “Download,” triggering the Delete Version/File functionality will delete only the files associated with that Version. The rest will remain intact.

If you have any questions please feel free to reach out to our support team via this contact form.

Was this article helpful?
Start Protecting your WordPress Downloads

Protect and track downloads on WordPress... What are you waiting for?