How to make WordPress database secure by changing default WordPress table prefix?

WordPress Database Security is the most important thing. Every single piece of information stored in it, which makes hackers and bots to target for stealing information by applying SQL Injection.

WordPress Database uses a default table prefix value “wp_” for the all of its database tables. Typically, every website that is running wordpress will have its database tables with this prefix and this can surely be used by the hackers or malicious bots to guess your database table names. That’s why the smartest thing to do while creating a WordPress website is to change the prefix of database, which can be done easily.

If you forgot to change the prefix of database table while creating your WordPress website, you can do this now by following these simple steps.

Note: It’s recommended to backup your database before performing this task.

There are two simple steps you need to follow:

Step 1. By changing the wp-config.php file:

  • Go to your WordPress root directory and search for a file named “wp-config.php”.
wp-config.php file



  • Open “wp-config.php” in any code editor and search for “$table_prefix  = ‘wp_’;”
  • Change “wp_” prefix to something like “Br1G@de” or anything you like.
WordPress database table prefix
Table Prefix


Note: Only alphabets, numbers and underscores.

Step 2. Change database table names:

Now you need to access your database using phpMyAdmin and change the table name’s prefix with the new one we entered in “wp-config.php” file.

You will find the phpMyAdmin link in cPanel under Databases section.

phpMyAdmin Database


By default there are normally total 11 tables listed

WordPress Database Default Tables
Default Tables


Select the SQL tab and run the simple queries and use the prefix you add in “wp-config.php” file.


 Note: If you have plugins installed, you have to make changes to those tables as well same we just did it with default WordPress tables.

Leave a Reply

Your email address will not be published. Required fields are marked *