Title: Corrupted wp_posts table
Last modified: July 2, 2020

---

# Corrupted wp_posts table

 *  [chaserpalmer](https://wordpress.org/support/users/chaserpalmer/)
 * (@chaserpalmer)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/corrupted-wp_posts-table/)
 * I recently had a hard drive start to go bad on my web server. I managed to create
   an image of the entire drive and then spun up a virtual machine using the disk
   image so I could try and repair my wife’s WordPress site.
 * I have nearly gotten everything back up and running, except for one major problem,
   the wp_posts table is corrupted.
 * I have tried everything I can think of:
    1. Manually rebuilt all of the tables
   and imported the *.idb files to re-populate the data into the tables. 2. Incremented
   innodb_force_recovery from 1 all the way to 6. 3. Ran ‘optimize table <table_name
   >;’ 4. Set WP_ALLOW_REPAIR and visited /wp-admin/maint/repair.php and ran the
   repair and optimize option.
 * No luck. I’ve probably put in 100 hours trying to fix this. Yes, I should be 
   backing up the database. Hindsight is 20/20. Yes, I could start over with a “
   factory fresh” WordPress site, but there are 5 years worth of posts that my wife
   doesn’t want to lose, if possible.
 * The error I am getting from the WordPress repair page is this:
 * > The wp_posts table is not okay. It is reporting the following error: InnoDB:
   > The B-tree of index PRIMARY is corrupted.. WordPress will attempt to repair
   > this table…
   >  Failed to repair the wp_posts table. Error: InnoDB: The B-tree
   > of index PRIMARY is corrupted.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [a2hostingrj](https://wordpress.org/support/users/a2hostingrj/)
 * (@a2hostingrj)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/corrupted-wp_posts-table/#post-13073006)
 * I suggest to read this article which talks about this issue, and offers some 
   steps to fix it:
 * > [https://blog.ghost3k.net/articles/mysql/169/fixing-mysql-innodb-index-corruption](https://blog.ghost3k.net/articles/mysql/169/fixing-mysql-innodb-index-corruption)
 *  Thread Starter [chaserpalmer](https://wordpress.org/support/users/chaserpalmer/)
 * (@chaserpalmer)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/corrupted-wp_posts-table/#post-13109116)
 * Thanks a2hostingrj. Unfortunately, I had found that article before I made my 
   post and I am still stuck.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Corrupted wp_posts table’ is closed to new replies.

## Tags

 * [corrupt](https://wordpress.org/support/topic-tag/corrupt/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [chaserpalmer](https://wordpress.org/support/users/chaserpalmer/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/corrupted-wp_posts-table/#post-13109116)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
