Hello,

We have a Webform on our site that collects user information with some file uploads. For our purposes, this information goes stale pretty quickly and we would rather not have the data accumulate forever. Is there a way to setup some pruning of the data to say maybe delete all submitted Webform data/files that are older than one month? Would this require writing a custom module to accomplish this or does something like this already exist? I searched around, but couldn't find anything.

THANKS

Comments

erich93063 created an issue. See original summary.

DanChadwick’s picture

Status: Active » Fixed

I don't know of a module that does this, but you can search. There is a Webform Clear module, which deletes the submission as soon as e-mail(s) are sent. This could maybe be modified to delete all the submissions beyond X using a cron task.

SoCalErich’s picture

Perfect. Yeah it looks like I didn't do quite enough homework first. I actually DID see the Webform Clear module, but according to the description on the project page, it only deletes submissions right after it emails them which is not what I would want. So I decided to download it and see if I could see how it worked and perhaps make my own custom module as you suggested and it turns out that it already HAS the functionality of giving it a time range to delete the submissions. You can delete them immediately , but you can also delete them after 1 day, after 7 days or after 30 days which is exactly what I needed.

THANKS

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Gomez_in_the_South’s picture

Just to document that the Webform Purge module does exactly what the original question asks for Drupal 7 - it allows pruning of webform submissions older than X days on cron.

For Drupal 8, this functionality is built into Webform.