The WP_ALLOW_REPAIR constant, when used, activates the native WordPress feature to repair corrupted tables in the database. The same feature can also be used to, in addition to repair, optimize tables.
If you are a seasoned professional, with advanced knowledge, prefer the use of tools for database management, or the unshakable terminal.
Using the WP_ALLOW_REPAIR constant
This constant must be placed in the wp-config.php file. Its value must be a true boolean. Like this:
define (‘WP_ALLOW_REPAIR’, true);
Once you have added this setting to the file and obviously saved it, access the following URL:
/wp-admin/maint/repair.php
WP will display the following interface:
A simple and explanatory interface with two alternatives: repair the database or repair and optimize the database. The difference between the two is that in the second alternative an optimization will be performed after the repair.
The result will be displayed as follows:
Delete configuration after use
The database must be repaired, and/or optimized when needed. This must be done by authorized persons. Therefore, after making use of the feature consider removing the
WP_ALLOW_REPAIR constant from the wp-config.php file.
Otherwise, anyone can perform these costly operations on your database and compromise the performance and operation of your application.
The file /wp-admin/maint/repair.php when accessed without the presence of the constant displays the following indicative message to the user:
Make good use of the resource when needed. That is when you need to automatically repair the problems in your WordPress installation database. As well as the need to optimize it.
This native platform feature helps in solving common and simple problems. For simplicity of use, it is a great alternative for people with few database experiences as well as for those even more experienced who need a quick and practical alternative.
Readers note: If your website is slow and you are planning to switch to another Webhost, check out our Fully Managed WordPress Hosting Service that can make your website 30x faster!