Changing WordPress Database Table Prefix Safely within 1 Minute

Default Prefix for Tables in MySQL is ‘wp_‘ You can change it. There are two methods, manual method and through a plugin. It is not recommended to do this on live sites. Once done, you have to clear the cache and make sure ‘nothing is broken‘.

Changing the data table’s prefix before installing brand new WordPress is easy. That will be possible while installing WordPress manually. Just change the prefix in wp-config.php first and then install WordPress. Once WordPress is installed and you want to change the prefix, you should follow the plugin method.

I personally suggest that it is not important to change the data table’s prefix as this will not improve security WordPress security. Here is an article from WordFence. If you would like to continue, open the ‘wp-config.php’ file in the home directory.

It is very important to take a complete backup of your website. Or, take a backup of the database which you are working on just by exporting it. Basically, you have to change two things.

  • Change the prefix in ‘wp-config.php’ file located in the ‘public_html’ directory.
  • Running SQL database query to change all table prefixes.

The below line inside in the wp-config.php says what your current prefixes are and you need to edit this by replacing ‘wp_‘ with ‘custom_‘. In our example below, we have changed the prefix from ‘wp_’ to ‘jxn_’.

$table_prefix = 'wp_';

We recommend not to change it manually. Utilize a plugin. This not only saves 99.99% of your time but also does the replacement of the prefix in every table perfectly in one go. The manual approach will take at least 15 minutes, digging in the databases, running SQL Queries by logging into your hosting account.

We recommend using Plugin, Brozzme DB Prefix & Tools Addons. And below is the process of how you do it.

First, install the Plugin. If Permissions for wp-config.php have changed, set it writable.

Database Prefix Change Before

Above is the screenshot of our test database before changing the table prefix. Everything is in its default.

wp-config File Permissions

As clearly mentioned in the plugin, make sure wp-config.php is writable file permissions. As shown below, it should be 644 by default i.e. (-rw-r–r–). In order to secure it, you can set the file permission to 660, but only after you change database prefixes.

Now we are going to change the prefix through this plugin. Here is what the plugin page looks like,

Plugin Database Prefix Change

Once you click on ‘Change DB Prefix‘ you should see the below message saying that the table prefix name replacement has been completed successfully.

Success Database Prefix Changed

Now if you go back to your database, and refresh the page, you should observe a complete change in database prefixes from the default ‘wp_’ to ‘custom_’.

Below is the screenshot of the changes the plugin did to your database.

Database Prefix Change After

Thanks to the plugin Brozzme DB Prefix & Tools Addons which makes this possible trouble-free and quickly all under a couple of seconds. If you have any questions, let us know.

Please note that our product recommendations are unbiased and targetted to be user-friendly. If you have any recommendations which isn't listed on our site, please feel free to contact us. We would be happy to review it.

Hey Don't Worry! The Email entered will NOT be used for sending NewsLetters. We respect your Privacy 🙂

Inline Feedbacks
View all comments