How to remove old events directly from database

Home Forums Calendar Products Events Calendar PRO How to remove old events directly from database

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32744
    Lukasz
    Participant

    Hi,

    I’ve a problem with the Events Calendar Pro. When I try to get into admin panel of the plugin, I get the error “memory exhausted”. I can’t get into events list or plugin settings.

    I suppose, that the reason is a number of events in the database, because few weeks before everything was OK. I have updated the plugin, and I don’t want to expand server memory (have 64MB already).

    So I think, that the easiest solution is to remove the oldest events from the database. So I remove few records in wp_posts table with post_type = “tribe_events”. Unfortunately, they still appear in the front-end of the calendar.

    So my question is, which records in the database should I remove to permanently delete the old events?

    Thank you,

    #32747
    Barry
    Member

    I’m not sure why they would keep showing up if you deleted the correct posts, although there is also meta data associated with each. How many events do you have in the system?

    I don’t want to expand server memory (have 64MB already)

    I’m guessing you are referring to the PHP memory_limit setting here rather than total server memory … just be aware that, depending on how and where you set this, it may not be respected depending on conditions put in place by your web host – so it could be worth checking in with your web host on that one.

    Also, though 64M should be fine in most cases, with PHP 5.3+ the default memory_limit is 128M – just to give a sense of perspective.

    Last but not least and still slightly rough around the edges (nor is this in anyway officially supported by Modern Tribe), here’s a plugin I put together to help clean up expired events automatically.

    #32752
    Lukasz
    Participant

    Thank you for your response. I have 300 events in the system – it is not many, but as I said – few events before there were no errors.

    Yes, I was talking about memory_limit – my web host will not allow me to expand this value at this moment.

    The plugin would be the best solution, but in order to activate it, I have to get into plugin settings, but there is an error occured, when I try 🙂

    Do you know how to find the meta data in the database, connected with the removed events?

    #32762
    Barry
    Member

    Do you know how to find the meta data in the database, connected with the removed events?

    If you’ve already deleted the event post then you’d need to look for meta entries that relate to a non-existent post ID. On the other hand, if you have not yet removed the relevant event posts you could investigate creating a script that uses WP’s wp_delete_post() function – which can remove not just the specified post but related meta data, attachments etc.

    #32763
    Barry
    Member

    The plugin would be the best solution, but in order to activate it, I have to get into plugin settings, but there is an error occured, when I try

    Strange, and unfortunately I can’t really offer any support for that plugin here (it’s not part of the official stable of Modern Tribe products). It may be just as well for you to solve this directly using a custom script or set of custom queries.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to remove old events directly from database’ is closed to new replies.