Remove Multiple Posts Via Database (Site crashing with Plugin Enabled!)

Home Forums Calendar Products Events Calendar PRO Remove Multiple Posts Via Database (Site crashing with Plugin Enabled!)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #13284
    Vincent
    Participant

    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!
    Vince

    #13326
    Rob
    Member

    Hey 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.

    #13376
    Vincent
    Participant

    Thanks 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!
    Vince

    #13424
    Rob
    Member

    Hey 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.

    #13481
    Vincent
    Participant

    Ok, thanks guys!

    #13512
    Joey Kudish
    Member

    Hi 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,
    Joey

    #13804
    Vincent
    Participant

    Thanks 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

    #13805
    Joey Kudish
    Member

    Hey 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
    Joey

    #975348
    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 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Remove Multiple Posts Via Database (Site crashing with Plugin Enabled!)’ is closed to new replies.