Support » Plugin: All-in-One Event Calendar » Removing old events

  • Resolved Outerbridge

    (@outerbridge)


    Hi

    Thanks for this plugin, it’s great.

    I have been using the plugin on one site for a few years. The events are often repeating and appear every week. The dashboard is getting cluttered and I want to remove the old events, say everything prior to 2017.

    How can I do this without messing up my recurring events please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @outerbridge,

    You would have to manually delete the old events from your database table. Here is the MySQL command, and you can use a database management program such as PhpMyAdmin:

    DELETE * FROM wp_posts WHERE wp_posts.id IN (SELECT wp_ai1ec_events.post_id FROM wp_ai1ec_events WHERE start < 1483228800000)

    where 1483228800000 is the unix epoch timestamp (used by MySQL) for Sunday, January 1, 2017 12:00:00 AM

    To get the current unix epoch timestamp at any other time, use:
    https://www.epochconverter.com/

    Hi Sunny

    Many thanks for your reply, that’s really useful. I’ll try it out on our development version of the site.

    Just one question, as the query you’ve provided deletes the items from the wp_posts table but doesn’t touch the wp_ai1ec_events or wp_ai1ec_event_instances tables.

    Should I run something like:
    DELETE * FROM wp_ai1ec_events WHERE end < 1483228800000;
    and
    DELETE * FROM wp_ai1ec_event_instances WHERE end < 1483228800000;
    to clear out these tables too?

    Many thanks!

    Hi @outerbridge,

    My apologies! Yes, you have to clear the wp_ai1ec_events and wp_ai1ec_event_instances after clearing out the wp_posts, as you have shown.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing old events’ is closed to new replies.