Database error unknown column

PHP errors beginning with WordPress database error Unknown column could be related to either Preload or Remove Unused CSS.

Easy solution

  1. Export your WP Rocket settings
  2. Delete and re-install WP Rocket
  3. Import your WP Rocket settings

This will re-create the necessary database tables and the error should not occur anymore.

Manual solution

If you don't want to reinstall, you can use the following method instead, but this requires greater technical know-how and the willingness to run SQL commands in phpMyAdmin. If you don't know how, or are not comfortable doing this, please use the easy solution above.

First, you have to identify which database table is referred to. Check the error message closely. If it references wpr_rocket_cache it's related to Preload. Example: 

WordPress database error Unknown column 'wpr_cache.is_locked' in 'where  clause' for query SELECT wpr_cache.id FROM wp_wpr_rocket_cache

If it references wpr_rucss_used_css it's related to Remove Unused CSS. Example:

WordPress database error Unknown column 'hash' in 'field list' for query INSERT INTO `wp_wpr_rucss_used_css

 You then need to drop (delete) the table mentioned in the error message, from the database:

  1. ❗️Make a full backup of your database ❗️
  2. In your WordPress site, disable either Preload or Remove Unused CSS, depending on which table is throwing the error.
  3. In your hosting control panel, go to phpMyAdmin
  4. If the error message is related to the cache table, run the command:
    DROP TABLE wp_wpr_rocket_cache;
    NOTE: If you have a custom prefix for your tables, you will need to replace wp with your custom prefix.
  5. If the error message is related to the rucss table, run the command:
    DROP TABLE wp_wpr_rucss_used_css;
    NOTE: If you have a custom prefix for your tables, you will need to replace wp with your custom prefix.
  6. In your WordPress site, reactivate the related feature. This will recreate the necessary database table.The error should not occur anymore.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.