**Do not do the below change unless you are comfortable with PHPMyAdmin and making changes to MySQL. If not, ask someone who is familiar with WordPress and MySQL to assist you. Also, backup your blog; it is of utmost importance that before doing any changes to your WordPress installation or database, to backup the whole blog including the database.
By changing the WordPress database table name prefix, you are automatically decreasing the chances of being a victim of a WordPress zero day SQL injection. vulnerability. In this article, I will provide a detailed step by step procedure on how you can change the WordPress database table name prefixes manually.
- Backup your WordPress database to a sql file. You can do so by using the phpmyadmin (typically available from your hosting service control panel) or if you have direct access to the server, you can use MySQL command line parameters to backup the database.
- Make a copy of the WordPress database backup file (.sql) in case you would need to restore the database.
- Open the WordPress database file (*.sql) using a text editor.
- Find and replace all “wp_” prefixes to “anything_” (anything_ being any value or word you would like to use).
- Drop all database tables of your WordPress database. Make sure that the tables ONLY are dropped and not the whole database.
- Import the modified WordPress database backup file (*.sql) using PHPMyAdmin or MySQL commands. You just restored the WordPress database using new table prefixes.
- Edit your wp-config.php file (which can be found in the WordPress root directory) and replace the value ‘wp_’ in the line $table_prefix = ‘wp_’; to the new assigned table prefix.
- There is a slight chance that your plugins will be deactivated automatically after following the above procedure. In that case activate them again manually. We always recommend that before doing such a change, the plugins should be all deactivated.
Get the latest content on web security
in your inbox each week.