Removing Expired Events From Database

Home Forums Calendar Products Events Calendar PRO Removing Expired Events From Database

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #26837
    S.
    Participant

    I’d like a simple way to remove expired events from the system. The events view on the backend does not have a column to display the end date of a recurring event, which is different than the event’s start/end dates that are displayed.

    I have over 3200 events in the database and most will never be displayed again. I’d like to clean things up. I’m brave enough to run a query in mysql (after backing up my db, of course) if anyone can formulate one for me.

    #26902
    Leah
    Member

    Hi S,

    Thanks for getting in touch. Of course, you can always just bulk delete events using the Bulk Actions dropdown in the dashboard, but I realize that with 3200 events (wow!) you might want something a little less manual.

    I’m not familiar enough with queries to help you out on this one, but I’ll have one of my fellows take a look on Monday and see if they can assist.

    Thanks for your patience!

    ~Leah

    #26993
    Rob
    Member

    Hey S. Thanks for the note here; we haven’t seen a lot of demand for this, and don’t have much in terms of an official solution, but I see we helped a user with a related issue a few months back in this thread: https://theeventscalendar.com/support/forums/topic/remove-multiple-posts-via-database-site-crashing-with-plugin-enabled/. Might that be of value to you here?

    #27050
    S.
    Participant

    Thank you, Leah and Rob.
    We run a community calendar (insidenorthside.com/insidescoop) that has a lot of multiple-date events: museum and gallery exhibits, farmers markets, etc, along with many one-day events. We have no need to display any event that has already occurred.

    I’d like to remove past events on the theory (and I may be wrong in this) that the calendar view will load more quickly (and yes, I know there is another thread concerning the slow-loading calendar view) if the EC system doesn’t have so many inactive events to sort through in order to generate the view, which takes about 15-20 seconds for our calendar.

    Rob, the thread you referenced gives an easy way to remove all events from the DB and that’s not going to help me. The process of removing posts where post_type is the Tribe event would be a start, I would need to refine the query to remove those types of post but only where the expiration date is prior to whatever date it is I want to start the removal at.

    So, can you please provide a list of which DB table/fields the EC generates or uses to keep track of an event’s start and end date? I’m browsing the table fields but I really don’t have time go through it all in hopes of picking the right one formulate a query with.

    Thank you.

    #27173
    Barry
    Member

    Hi S. I’ve written a plugin that could be useful here – you can read more and download it from my blog. Important things to note:

    • It’s brand new, so back-up before you first put it to work
    • By default it runs once a day and removes up to 100 events at a time, so in a case like yours it might be a few days before everything is cleaned up
    • This is something I cooked up by myself, it is not an officially supported plugin and no one is going to offer up any level of official support for it here

    With all that said, it might come close to fitting your needs 🙂

    #27194
    S.
    Participant

    Thank you Barry. Your plugin sounds like it will do the trick and I’ll let you know how it works.

    #27211
    Leah
    Member

    Definitely keep us posted! Thanks!

    #27450
    Barry
    Member

    Just a note, the Housekeeper plugin has been updated to provide improved handling of recurring events.

    #27531
    Barry
    Member

    OK, so I’ll now close this out but if you have any further questions or concerns please feel free to open a new thread or email us.

    As a final note, The Events Calendar: Housekeeper is available in the WordPress directory and any future updates – and requests for support – ought to be made there.

    Thanks 🙂

    #27532
    Barry
    Member
    #978100
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Removing Expired Events From Database’ is closed to new replies.