Support

Home Forums Event Espresso Premium EE3 deleting old events and attendees for GDPR compliance

EE3 deleting old events and attendees for GDPR compliance

Posted: April 13, 2021 at 3:42 pm


iaeonpac

April 13, 2021 at 3:42 pm

I cannot find any easy way of deleting old events and all associated attendee records from EE3. It would be something like this:

1) Delete attendee records associated with events >365 after event date
2) Delete events >365 days after event date

Any help gratefully appreciated. There are hundreds of events on the system so it is no practical to do them one by one.

This is needed to be fully GDPR compliant


iaeonpac

April 18, 2021 at 5:17 pm

Hi

I would appreciate a reply to this please as I need to find a way of dealing with this issue.

If there is nothing simple perhaps a SQL query to run directly on the database?


Tony

  • Support Staff

April 19, 2021 at 5:56 am

Hi there,

I recommend before you move forward with this you create a Database backup just to be safe, you can delete it once you’ve confirmed the events/data you expected to be removed has been but without one you’ll be stuck if you need the data.

We don’t have the option to select/delete events after 1 year from today but you also don’t need to select the events individually with the current version of EE3 as you can do them monthly.

This would be the officially supported method within EE3 at this time:

Go to Event Espresso -> Event Overview.

In the dropdown filters, select the earlier month.

Set the status filter to ‘All (Active / Inactive)’

Set the number of the rows next to the ‘Retrieve’ button to ‘all’.

Click the retrieve button: https://monosnap.com/file/MJdcyYLugG16IbJS0a3jmreGXJFa1F

That will filter to show all of the events for the selected month and year.

Click the checkbox at the top of the list to select all and click ‘Delete Events(s)’: https://monosnap.com/file/VWsDPHiMqijN75Z7AhyqG90YhXDrxB

(Note this is a ‘soft delete’ in that the events are marked with a status of deleted but not removed from the database, we’ll do that later and you’ll see why shortly)

Clicking the confirmation above will ‘delete’ the events and then reset the filters, set the same options again and repeat individual month until you want to stop.

Now from there, you can permanently delete the events. EE doesn’t do so from above to prevent users from deleting the data accidentally with no way to get it back.

Go to Event Espresso -> Event Overview.

Set the ‘Status’ filter to ‘Deleted’ and select the number of rows to a manageable value. Don’t use ‘All’ as you’ll likely just cause timeouts, there is a lot of data to process here.

This is an example from one of my sites: https://monosnap.com/file/1V7rdkdx6yEpXSRXBN0Tm3iK5KwScf

Click the Checkbox at the top of the table to select all of the current rows on the page and click the ‘Permanently Delete Event(s)’ button at the bottom.

This removes more data than you mentioned above as the data related to events is stored in multiple tables.

The above deletes all rows from:

EVENTS_DETAIL_TABLE
EVENTS_START_END_TABLE
EVENTS_PRICES_TABLE
EVENTS_DISCOUNT_REL_TABLE
EVENTS_ATTENDEE_TABLE

Where the event ID is passed for each event, which is why I mentioned above not to try this in large batches. 100 is likely fine, 200 also likely fine but it all depends on your server so up to you how many times you want to try at once.

Unofficially (so you should consider it untested) you can do this via code, which would be something like:

https://gist.github.com/Pebblo/d301423a20c85e93f0f36c2c4b3435cd

That does 200 rows at a time, you could add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Each time you load a page 200 events will be processed until they have all be done, you should then remove the above code from the site and manage any additional events using the method I posted first.


iaeonpac

April 21, 2021 at 9:10 am

Thank you for that very comprehensive reply.

Easy when you know how! I probably missed spotting this information somewhere in the documentation.e


Tony

  • Support Staff

April 21, 2021 at 11:10 am

You’re most welcome 🙂

I don’t think we have much documentation for the above in EE3.

The support post ‘EE3 deleting old events and attendees for GDPR compliance’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Do NOT follow this link or you will be banned from the site!