WordPress is deleting some post and attachment metadata
July 4, 2016 4:08 PM   Subscribe

Issue: WordPress is deleting metadata for certain posts (a specific post type actually) and attachments. These seem to be recently added items (the last month or so - it appears to keep the data added prior to that intact).

Right now, I have a custom post type that has three custom fields. This custom field data gets deleted from the posts (again, just the recent ones) whenever I save a post or a page. All of the posts lose their data, and a fair number of images lose their metadata.

The actual content of the posts doesn't get deleted, just those custom fields, but unfortunately that data is the most important part of the custom post type.

The entries in the database are definitely deleted - I use PHPMyAdmin to check the data before I edit the post that ends up deleting the data - I check after I've saved the post, and the data is gone.

Is this an issue with some sort of stuck MySql transaction? I'm running MySQL 5.1.63 rel 13.4 I believe.

Experienced on two separate hosts.

I'm running an up to date version of WordPress. All plugins and themes (Genesis child theme, Metro Pro) are up to date as well.

This seems to have something to do with memory - if I disable a couple of what I would assume are memory intensive plugins, the issue goes away. Note, that I've tried this by disabling/enabling different plugins, and the issue does not seem to tied to a single plugin. There are some plugins I can't disable without making the site unusable.

I ran a logger that logs and wpdb traffic for INSERT, UPDATE, and DELETE, and I don't see anything unusual there when I save a post that ends up deleting the other metadata. There's nothing specifically overwriting or deleting those items in the database.

Hoping someone out there can help!
posted by backwards guitar to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
Did you try increasing the memory?
posted by Foci for Analysis at 6:06 PM on July 4, 2016


If you're comfortable looking directly at the database, are you also comfortable taking a look at the source code? Where is this type of metadata defined? What's going on when it's being saved? It's odd that you don't see anything funky going on at the DB level-- I mean, the data is obviously getting overwritten or deleted, why isn't it showing up in the logs?

A quick google suggests a possible involvement with Quick Edit-- does that sound likely? Otherwise, possibly max_input_vars settings?
posted by instamatic at 7:02 PM on July 4, 2016


Response by poster: I have increased the memory, but haven't noticed any difference.

The metadata is defined in custom code I've written. I'm using CMB2 on the back end to handle the custom fields, and it seems to be working fine, so I don't think that's the issue. Plus, not all posts are getting overwritten, just the somewhat recent ones, which is why I wondered if it was a MySQL issue.
posted by backwards guitar at 8:03 PM on July 4, 2016


You updated the memory, but did you check the max_input_vars?
posted by instamatic at 8:13 AM on July 6, 2016


Other suggestions: Stack Exchange is a great place to ask tech questions, and there is also an advanced WordPress Facebook group.
posted by instamatic at 8:20 AM on July 6, 2016


Response by poster: I changed max_input_vars, but still no luck. I'm going to rebuild the site elsewhere and see if that helps. Yes, I'll look into Stack Exchange.
posted by backwards guitar at 9:38 AM on July 7, 2016


« Older Mac Mail: Stop downloading my messages   |   Getting a graduate degree in one field, but want... Newer »
This thread is closed to new comments.