Using wp-config.php to Automatically Repair WordPress Database Problems

Posted OnOct 30, 2013     CategoryDevelopment     CommentsNo comment

If you are trying to load your WordPress site in any way, be in a post, page, or even the WordPress Dashboard, and are seeing the following message, this indicates that there is a problem with your Database.

To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file. Once this line is added to your config, reload this page.

define('WP_ALLOW_REPAIR', true);

To fix this, you will need FTP/SFTP/SSH access to your server.

Step 1) Log in to your server with FTP/SFTP or SSH.

Step 2) Locate and open wp-config.php

Step 3) Add the following line and save wp-config.php

define('WP_ALLOW_REPAIR', true);

Step 4) Visit http://www.yoursite.com/wp-admin/maint/repair.php and you will see the following

wordpress database repair and optimize

Step 5) Click “Repair” or “Repair and Optimize” and wait for the script to run. You will see a message similar to the following if it is successful.

successful wordpress database repair and optimize

Step 6) As instructed, remove define(‘WP_ALLOW_REPAIR’, true); from wp-config.php and save.

If this doesn’t work, feel free to try a Database Repair using phpMyAdmin


Leave a Reply

Your email address will not be published. Required fields are marked *

Send this to friend