Home › Forums › Calendar Products › Events Calendar PRO › Slow loading – Delete/Archive old events?
- This topic has 8 replies, 2 voices, and was last updated 9 years ago by Barry.
-
AuthorPosts
-
March 18, 2015 at 10:43 am #949180nothingtodoParticipant
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?
March 18, 2015 at 1:04 pm #949227BarryMemberHi!
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?
March 18, 2015 at 1:22 pm #949231nothingtodoParticipantThanks. Unfortunately when I try to delete old events I get “error moving to trash”. Do you know why that might be?
March 18, 2015 at 1:50 pm #949233BarryMemberI’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.
March 19, 2015 at 1:23 pm #949464nothingtodoParticipantIt’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?March 19, 2015 at 4:50 pm #949557BarryMemberHi 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.
March 26, 2015 at 9:19 am #951157nothingtodoParticipantSo 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.
March 26, 2015 at 10:54 am #951212BarryMemberIt’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!
April 13, 2015 at 7:47 am #955046BarryMemberHi!
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!
-
AuthorPosts
- The topic ‘Slow loading – Delete/Archive old events?’ is closed to new replies.