To repair WordPress database

If your WP database is broken, the possible fix is to add the next line to the wp-config.php file

define('WP_ALLOW_REPAIR', true);

The file can be edited via FTP or host’s dashboard like CPanel.

After editing open repair.php file via browser on your site. An example:

… or

As wp-admin/maint/repair.php must be added after your site’s URL (name).

Repair can take a some time and within repair you may see messages like ”database connection error”. Refreshing the site helps if nothing seems to happen for a long time (F5 frefress the page).

When repairing is ready you get a message like.

After repairing you must remove define('WP_ALLOW_REPAIR', true); line from wp-config.php file.