Home › Forums › Calendar Products › Events Calendar PRO › Remove Multiple Posts Via Database (Site crashing with Plugin Enabled!)
- This topic has 8 replies, 4 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
January 12, 2012 at 12:10 pm #13284VincentParticipant
Hello,
Firstly, thanks for all the work that has gone into this excellent plugin! Secondly, I did come across a potential bug on my website (offmetro.com/sf/). One of my writers somehow accidentally posted a recurring event for every day from 1970 until today. This ended up crashing my VPS (due to high CPU and I/O) and taking me forever to debug. Eventually I saw the article and disabled the plugin, and all is running smoothly. However, I’d like to remove every event post (there are thousands) that has the same title, so I can reenable the plugin. Is there an easy way to do this via the database and phpmyadmin? Where are the events stored?Thanks!
VinceJanuary 13, 2012 at 8:39 am #13326RobMemberHey Vince. Thanks for reporting this and sorry to hear that you’re having issues. Not sure how to resolve this myself, but let me see if our dev Jonah has any suggestions. I’ll get him to respond here today.
January 14, 2012 at 6:45 am #13376VincentParticipantThanks Rob.
Jonah – let me know if I can provide any additional info. I guess the basic question is, how can i easily remove all events with the same name via the database, without activating the plugin (since it is crashing my server)?
Thanks!
VinceJanuary 16, 2012 at 3:57 pm #13424RobMemberHey Vincent. I talked this over with Jonah today and he’s a bit stumped as to what could be up; just wanted to confirm that I’ve passed it on to a member of our advanced dev team for review and should have you an answer over the next 24 hours. Apologies for the delay on that front.
January 16, 2012 at 8:30 pm #13481VincentParticipantOk, thanks guys!
January 17, 2012 at 1:32 pm #13512Joey KudishMemberHi Vincent,
Yes, you can remove all events directly from the database.
WARNING: BACKUP your database before you do this. Seriously, back it up. I don’t want you to accidentally lose anything in your database. Also, please understand that you are doing this at your own risk, we don’t usually encourage users to manipulate the database directly and can’t provide support for doing this. But we’ll happily provide guidance.
Ok now that the warning is out of the way 🙂
I’ll give you the longer answer with the explanation and then the SQL command you can run to delete them all.Events are a custom post type within WordPress, which means that they are stored in the posts table along with all other posts, pages and other custom post types. The way to differentiate them from other posts, is with the ‘post_type’ column. Events registered with The Events Calendar will have ‘tribe_events’ as their post type. So your goal here is to delete all entries from the posts table with the ‘tribe_events’ ‘post_type’. So here’s the SQL you can run directly from phpMyAdmin:
DELETE FROM wp_posts WHERE post_type = 'tribe_events'
Note: you may need to change wp_posts to customprefix_posts if your table prefix is different (as defined when you installed WordPress)
Again, this is quite an advanced request and we advise you to act with caution and backup first 🙂
Hope this helps, let us know if you have any further questions.
Cheers,
JoeyJanuary 22, 2012 at 5:45 pm #13804VincentParticipantThanks guys. With your instructions I was able to go into the database and delete the last event we created. I believe one of my writers had created it as a repeating for every day from 2007 onwards. You may want to try this out for yourself – creating repeating events for an incredibly long period of time. I’ve had the plugin deactivated for the last several days, but today I activated it to try and find out the name of the last story we wrote. You can see here: http://i42.tinypic.com/168wxoo.png where there’s a huge CPU spike as soon as I did that. I actually couldn’t get into the event section to view the events, so I quickly deactivated the plugin again and the CPU returned to normal. Then I went into the database and found the last post, deleted that one post in the database, and reactivated the plugin. Thankfully the CPU stayed normal after that, and it’s been ok since then.
In any case, you may want to check it out. But thanks again for your help, all is well now!
Vince
January 22, 2012 at 5:48 pm #13805Joey KudishMemberHey Vincent,
I want to fully understand your explanation, so allow me to clarify please. Are you saying that the CPU went up whenever you created a long repeating event (approx. 4 years) ? What was the frequency of the event (daily, weekly, monthly, etc..) ? And would the CPU usage stay up at all times or only when performing a specific action?
Thanks
JoeyJuly 3, 2015 at 5:00 pm #975348Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Remove Multiple Posts Via Database (Site crashing with Plugin Enabled!)’ is closed to new replies.