How to Change Table Prefix in WordPress to Improve Security

Are you running a WordPress site and want to secure your site from hackers/attackers? There is very easy for hackers to inject the SQL injection in your WordPress site if you have used the default table prefix during your WordPress standard installation because of everyone know the WordPress default table prefix that is “wp_” and it is easy to attack your site by using the SQL injection, then why not change the default table prefix from “wp_” to something else.

change database prefix

WordPress Database Table Prefix

It is also recommended by many WordPress experts to change the WordPress database prefix to improve security. Before the change the table prefix please make sure you have taken backup of your site database and wp-config.php file and also make sure wp-config.php file in writeable mode.

Login in your database by using the PHPMyAdmin and select your site database. Now open SQL tab and copy paste below SQL queries then click on the Go button to execute.

Change Table Prefix in wp-config.php

After changing the table prefix login in your website by using the FileZilla FTP client and open wp-config.php file. Now change the table prefix line from “wp_” to something else like this “wp8xant_”. It should look like:

Change Options and UserMeta Table

Now change into options and user meta tables by executing the bellow SQL queries.

Change WordPress Table Prefix Using Plugins

You can also use Change Table Prefix WordPress plugin to change your WordPress table prefix. I have used this plugin in many websites to change table prefix. The latest version of this plugin is compatible with WordPress multisite installation as well. Below are some features of this plugin:

  • Change your site tables prefix in one single click.
  • Also Works with WordPress multi-site database.
  • Prevent your site from SQL injection.

The installation of this plugin is very simple and easy like other plugins are. If you have just started with WordPress, then check out:

After the installation of this plugin activate it by clicking on Activate button via Plugins => Installed Plugins menu option. Now navigate to the Settings => Change Table Prefix option to change your table prefix and click on the Click to change table prefix button.

Change Table Prefix ‹ FreeWebMentor — WordPress

By default, it will generate the random table prefix and if you want to change as you want then marked checked the checkbox and enter the table prefix as you want to change.

Change Table Prefix ‹ FreeWebMentor — WordPress

Over to You

If you still need any help to change table prefix, then feel free to put your comments in below comment section. I will be happy to help in changing the database table prefix for your website. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , , , , , , , ,