• Resolved Dayāketu

    (@austmathr)


    Hello everyone!

    I am having problems doing database backups and I’m cleaning my database. I don’t have comments enabled and since there were lots of null and empty values in wp_postmeta, I deleted the plugin to make space.

    I saw that data was not actually deleted from wp_postmeta. Is there a safe way to delete akismet information from my wp_postmeta (and any other tables if any)? I was surprised that data was not deleted and I have searched and seems that there is no info regarding wp_postmeta (my wp_commentmeta is empty since I have no comments).

    Can you please help me on this regard?

    Thanks a lot for your help.
    Best regards,
    David.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support csonnek

    (@csonnek)

    Happiness Rocketeer 🚀

    Hi David:

    It looks like you already sent us an email regarding this question. I’ve already flagged that email for one of our developers to respond and someone should be back in touch shortly with instructions.

    Marking this as resolved as we’ll be in touch via email.

    Hi David,

    I’ll reply here, in case it becomes useful to others.
    Once deleted, the plugin itself can’t really help.

    This said, all Akismet meta keys stored in the DB start with akismet_, such as akismet_as_submitted. You could delete them with an SQL command using WHERE meta_key LIKE 'akismet_%'. But note that you might want to limit that command to a few hundred keys at a time, if you have a very large table, or a slower server.

    The plugin has its own cleanup methods, if you’d like more inspiration: https://plugins.trac.wordpress.org/browser/akismet/trunk/class.akismet.php?rev=1893537#L30

    • delete_old_comments_meta()
    • delete_orphaned_commentmeta()

    Hope this helps.

    Thread Starter Dayāketu

    (@austmathr)

    Thanks Stephane.

    These methods delete the information within wp_postmeta or only on wp_commentmeta? I am asking since my wp_commentmeta is empty actually and wp_postmeta is big. Also, how am I able to run them to delete the information via these methods? I’m thinking on installing again just to safely delete via the same plugin.

    Regarding direct database query, I have seen that I have records that have meta_value as empty and some as NULL. Is it safe to delete everything that has meta_key LIKE ‘_akismet’ then? Will this leave any orphaned records?

    Thanks a lot for your help.

    Hi Daniel.

    Akismet does not store any data in WordPress’ wp_postmeta table, only the wp_commentmeta table. Could you post an example record of Akismet-related data in your wp_postmeta table? The only context in which I know there could have been any is with a very old and very obsolete version of the bbbPress forum software, not WordPress.

    The methods in the plugin are there to run regularly scheduled cleanup jobs, not to delete all of the Akismet related data itself. They only delete data that the plugin considers obsolete.

    Be extremely careful with the delete command, should you choose to use it. For example, it’s akismet_%, not _akismet. Our meta keys start with the string akismet_.

    Here is an article (not by us) that might help you with cleaning up up more than just the Akismet data: https://www.smarthomebeginner.com/clean-wp-commentmeta-wp-postmeta/

    But once again, be very careful with any delete queries. My advice is to start with a SELECT query, look at the data, then use a (or series of) DELETE query/ies to only delete what you are sure is okay to get rid of.

    Thread Starter Dayāketu

    (@austmathr)

    This is strange then.

    I have 2K records in my wp_postmeta. You can see an example here: http://share.epiclemon.com/3D0J1O052T1k

    The meta_key is _akismet, not akismet_, so this is not regarding your plugin? Can you please confirm me about this?

    I have never had bbbPress in my website. Also, in the meta_value I have values as blank and as “NULL”.

    Hey Daniel.

    This is puzzling indeed, and it’s not from us. Let me look a few things up and get back to you shortly. 🙂

    Hi again,

    I’m waiting for some answers from a friend as to what could be the source of those.

    As I said, those are not from the Akismet plugin, but they could have been from another plugin that interacted with the Akismet API, and managed their own meta keys. They don’t look like the old bbPress meta keys we’d expect to see, so it would likely have been something else.

    As far as we’re concerned, those keys don’t look like anything valuable (truncated key name, NULL value, etc), and if it were me, I’d simply go ahead and delete them. It would be interesting to see if once deleted, more are being created, implying whatever plugin creates them is still active on your site.

    I’ll get back to you once my friend has replied.

    Thread Starter Dayāketu

    (@austmathr)

    Stephane,

    I solved the mystery now 🙂 I cross-checked the post that was creating this (via post_id) and I found that this is related to Flamingo plugin (https://wordpress.org/plugins/flamingo/). On one of the database column I saw a string with flamingo in it. I installed this plugin long time back for some months and deleted after a month of testing it, since it was not fitting my needs. I contacted the author to see how to delete them, and had to re-install, and delete via the plugin. Now all the records are gone.

    Just wanted to update you so that you know this special scenario as well with this plugin. Thanks so much for the assistance.

    Best regards,
    David.

    Thread Starter Dayāketu

    (@austmathr)

    Marketing as solved.

    Awesome. Glad this got sorted out, and thanks for the info.

    Cheers! 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Safely deleting wp_postmeta content’ is closed to new replies.