How to Easily Change the WordPress Database Prefix

Heads up: This page may include affiliate links. Read the full disclosure.

A basic security change to make on your child sites is to change the WordPress database prefix. The default WordPress database prefix is normally wp_. An easy plugin to be able to change all of the database tables on a sites database as well as update the prefix table value in the sites wp-config.php is by using the Brozzme DB Prefix & Tools Addon plugin.

After the plugin has been installed and activated it will add a menu item;

Tools > DB PREFIX

Before you change the WordPress database prefix you should create a database backup of the sites database you can do this from phpMyAdmin or using a plugin like WP Migrate DB.

In order for the plugin to work correctly, you will need to make sure that the sites wp-config.php file is writable and that MySQL has altered rights. In the plugin settings page, you will see the current WordPress database prefix then you can select the prefix you want to use or have the plugin to randomly create one if you.

After the change has run it will show that the database table prefix was able to be changed and also the table prefix would have been changed in the sites wp-config.php file.

$table_prefix = 'p43sd3_';

Changing the sites database prefix will mean that your site will be less likely to be hit by spammers or hackers running scripts that would try to target the default WordPress prefix of the database on SQL injections. Since the database prefix of the tables has been changed then that part is less likely to be guessed. So taking the time to change the database prefix on your child sites is an easy and quick security change to make.

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.