Slow loading – Delete/Archive old events?

Home Forums Calendar Products Events Calendar PRO Slow loading – Delete/Archive old events?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #949180
    nothingtodo
    Participant

    My site is loading like cold molasses and I’m guessing it’s because I have so many events. I know recurring events are supposed to delete after 12 months but what about single events? I run a calendar for two cities so I generate a lot of individual events. Is there an automagic way to clear out old events?

    #949227
    Barry
    Member

    Hi!

    I’m afraid that – right now – there is no such capability (to clean up expired single, non-recurring events) within our plugins. It’s a great idea though – and one we’d encourage you to post on our UserVoice page for future consideration … in fact there is an existing request you might add your support too 🙂

    Until something is implemented, though, it would really need to be managed either by manually deleting events or else a custom-built tool of your own.

    Does that help, or at least clarify things as they currently stand?

    #949231
    nothingtodo
    Participant

    Thanks. Unfortunately when I try to delete old events I get “error moving to trash”. Do you know why that might be?

    #949233
    Barry
    Member

    I’m not sure why that would be – and it’s not impossible that a conflict with another plugin or something of that nature could be at work. Do you find that the event genuinely is not trashed? Certainly in the past we’ve had reports of this error but, even so, the event or events are moved to the trash successfully.

    #949464
    nothingtodo
    Participant

    It’s not trashed. I have better luck doing them one by one…. but I have thousands.
    Is there a way for me to go in through ftp and take out old events that way?

    #949557
    Barry
    Member

    Hi nothingtodo,

    They’re stored in the database rather than in the file system – so I’m afraid going in by FTP isn’t going to be the solution here.

    #951157
    nothingtodo
    Participant

    So the only way is to do everything through the WP dashboard? If I try to delete more than one at a time I get an error.

    #951212
    Barry
    Member

    It’s probably possible to craft a SQL statement to do this work if you’re comfortable with that sort of work? I would of course recommend you make a full and complete backup – and ensure you know how to restore the backup – before carrying out such an operation.

    Here’s the SQL I’m thinking of:

    DELETE FROM wp_posts WHERE ID IN (
        SELECT 
            post_id
        FROM
            wp_postmeta
        WHERE
            meta_key = '_EventEndDate' AND
            meta_value < CURDATE()
    ) AND   post_type = 'tribe_events';

    This will “orphan” a number of post meta table entries which could be cleaned up with some further SQL:

    DELETE FROM wp_postmeta 
    WHERE  post_id NOT IN (
        SELECT 
            ID
        FROM
            wp_posts
    );

    Again, apply with caution and only if you are comfortable operating directly on the database!

    #955046
    Barry
    Member

    Hi!

    It’s been a while so I’m going to go ahead and close this topic.

    • Need help with anything else? Go right ahead and post a new topic, one of the team will be only too happy to help
    • Still need help with this issue and need to re-open it? Again, please simply create a new topic and link to this one to provide the team with some context

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Slow loading – Delete/Archive old events?’ is closed to new replies.