How To Rename WordPress MySQL Database Table Prefix Easily

WordPress database tables contain all the sensitive information including user data. Therefore it’s better rename default MySQL database table prefix. Because everyone knows the default name. Therefore hackers can easily run SQL injections. In order to increase the security of your site, it’s highly recommended to apply a custom name. If you followed the manual WordPress installation method, most of the time (if you have not changed) your database tables uses default wp_ prefix. It’s a one of the security vulnerabilities in this system. However if you followed the automated method, it allows user to customize the installation. That’s why I personally like the automate WordPress installation method.

There are several methods to change the WordPress database table prefix. They are PHPMyAdmin or WP plugin.  In this tutorial I’m going to use Change DB Prefix free plugin. Because it’s easier and no need to follow long steps. However if you have a huge database this tutorial not recommended to you.Wordpress MySQL logo image   Unlike some of the table prefix changing plugin, this one allows the user to apply a custom text. Therefore you can create your own unique prefix. Make sure to use an unguessable text with two underscore. Before follow this tutorial it’s highly recommend to backup the database. Unlike the PHPMyAdmin based method user don’t need to change the wp-config and it’s not necessary to change each and every table prefix one by one manually.

How to rename WordPress table prefix manually.


  • In your WordPress dashboard, go to “Plugins>Add New”.
See also  How To Install WordPress Using Fantastico Installer On Cpanel

Add new WP plugin

  • Then type Change DB Prefix and click on “Search Plugins” or download the plugin using following link.
Developer: Ms. Bhumi Shah
Price: Free
  • Click on the “install” button or upload the plugin zip file via cPanel or FTP client to wp-content/plugin folder and extract.
  • Then activate the plugin though the dashboard.

Activate the plugin

  • Next go to “Settings>Change DB Prefix”.

Change DB settings

  • It will automatically detect the existing database prefix.
  • Under the “New Prefix”, type the new unique WordPress MySQL database table prefix.
  • To apply the changes click on “Save”.

Change DB page

  • Within few seconds your page will be refreshed and completed the database table prefix rename.
  • Login to the cPanel PHPMySQL Admin and verify all the table prefix have been renamed.

Once you have renamed the table using the above steps, it’s very unlike to receive errors. However if you if you received any error make sure that “wp-config” file contain “$table_prefix” section updated to the newest table prefix. Apart from that if there’s any table prefix not changed correct them using PHPMyAdmin by using the following command line (make sure that you have replace new and old with your own prefix).

RENAME table `old_commentmeta` TO `new_commentmeta`;

Video tutorial.


If you need to rename the database with a user, you can follow my this tutorial.

Developer: Ms. Bhumi Shah
Price: Free

error: Content is protected !!