[Resolved] Restore wp_postmeta from wp_posts
I was tasked to move a wordpress site from one hosting account to another recently. When I looked at the database to dump it, I noticed that it was half a gigabyte full of spam posts. There were approximately one-quarter of a million posts that were attributed to authors other than the legitimate author. Being that I only had phpMyAdmin to download the data, I could not get it all before the web server timed out, etc. I could have used a script to chunk the database into multiple downloads, but had been told I could go ahead and remove “some spam.” So before removing all the spam posts, I decided to delete all the spam postmeta first. I was using a subquery with an IN clause and accidentally used a “double negative.” To make a long story shorter, I deleted the meta data for all the legitimate posts. doooohh!
Now, the pages menu doesn’t even show up (well, it has blank spots!) Only a couple of the hundreds of posts show up under All Posts in wp-admin.
I was wondering if anyone could give me some clues as to what values I could restore to the wp_postmeta table to restore posts at least to the admin portal.
A) Try: Delete the spam comments from the table using phpMyAdmin.
B) Try: Use WP export tool and once downloaded manually delete from file the comments.
C) Use a third party tool such as Windows Live Writer to capture the html of the posts/pages and rebuild site from scratch.
Advise web site owner to not allow comments with links and new users above subscriber role….this is what happens..
Thanks for your reply.
Actually, if you read more carefully, comment spam is not the issue here (I wish it were.) The problem is I inadvertently deleted the wp_postmeta data.
I was hoping to reconstruct enough of that table so that the posts show up in the admin portal at least. I was hoping that someone might be able to show me a little direction in that regard.
I went to archive.org and just setup the menus as they were. For now, problem solved.
- The topic ‘[Resolved] Restore wp_postmeta from wp_posts’ is closed to new replies.