WPDB WP Core Database SQL index, primary keys fix script
This will re-add indexes, keys, primary indexes and enable auto-increment.
Read carefully: if you really do have primary keys (ask your webhost or webmaster) right now this script is not for you.
We even have fixes for you to delete rows where your primary key is lost and the “primary key” values are zero (0). The script will remove those corrupted rows.
The script will give you DELETE and MODIFY/ALTER table queries.
Warning: this is tested on mysql and mariadb for a single WP Core site (not a multisite), it might not work on your site, so make a backup first.
This will only fix your WordPress Core tables (users, posts etc..) it will not fix any other non-WP-Core tables (such as GravityForms or any other plugin or custom tables).
- Download the zipfile
- upload the PHP file into wp-content/mu-plugins/ (create the mu-plugins folder if it does not exist yet).
- Make a database backup first
- Visit your site and copy the SQL commands in your database tool
- Remove the wp-content/mu-plugins/ script