WordPress Database Repair Script In 2.9

A little tip for all users of the existing beta of WordPress 2.9 and for all who wish to update soon to the new version. With version 2.9 WordPress conducts its own routine to optimize the database. Previously it was done by either Plugins or via SQL access. From the next version this function is implemented in the core …


… which you can activate with the help of a constant; stored in wp-config.php, you have access to the script.

define('WP_ALLOW_REPAIR', true);

Call the script from the outside at the following address …

… where you either repair the database or run the optimization. Technically, there is no magic behind this work, but the familiar SQL statements ANALYZE TABLE, REPAIR TABLE and OPTIMIZE TABLE.


I guess that will start a debate, why with the constant and why from the outside, etc. – leave your comment here. Alternatively, anyone can contribute to WordPress and discuss directly with the developers or enter changes directly to the code.

Comments are closed.


  1. Chris Harrison

    Works like a charm!

  2. Alex

    @Chris, good to hear!

  3. Kel

    Works as advertised. Even with the just released 2.9b1 – however it ONLY repairs/optimizes the core WP tables – not anything else added by other plugins etc.

    FWIW, at this stage of 2.8.x I’d probably suggest looking at Lester Chan’s WP-DBManager which allows access, repair and optimization of ALL tables, records etc. http://lesterchan.net/portfolio/programming/php/#wp-dbmanager

  4. digitalshoptime

    The repair didnt work for me. Any other sugestion ?

  5. berny


    I’ve just opened a ticket including a patch that allows to repair all $wpdb->prefix tables.


One pingback

  1. Nueva version 2.9 de WordPress « Walhez