WordPress Table Prefix – How & Why To Change It | WP Learning Lab

WordPress Table Prefix – How & Why To Change It | WP Learning Lab

Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist: https://wplearninglab.com/17-point-wp-pre-launch-checklist-optin-yt/?utm_source=YouTube_Video&utm_medium=Description_Link&utm_term=Description_Link&utm_campaign=YouTube

Download our exclusive 10-Point WP Hardening Checklist: http://bit.ly/10point-wordpress-hardening-checklist
WordPress Table Prefix – How & Why To Change It | WP Learning Lab

In this tutorial I’m going to show you to change your WordPress Table Prefix. There are two ways. One is to make the change in the wp-config.php file when you are installing WordPress.

In the wp-config.php file you will see an area called WordPress Database Table Prefix. You will see wp_ as the value for the table_prefix variable.

That wp_ is standard for all WordPress installations, so if you don’t change that value any hacker and dataminer knows all the table names of used for your website. In certain situations this is a major security risk.

You can change the wp_ to any sequence of numbers and letters (no special characters and it can’t start with an underscore). It’s wise to end the table prefix with an underscore so that you can more easily read the name of the table.

For example, a table that exists in every WordPress sql database is wp_options. That table name is very easy to read. If you don’t use an underscore and that table name becomes i332hrnfeowoptions it’s much more difficult to read.

If you have already installed WordPress you can WordPress change database tables by using the Change DB Prefix plugin.

After you’ve installed and activated this plugin the settings are pretty simple. It pulls in your current database prefix. In the field below it you enter the desired table prefix of your WordPress MySQL database and click Save Changes.

The only thing is, you can only do this once. So make sure you pick a good database prefix that you’re not going to change later. A good one is hard to decipher and/or guess.

I prefer the MASH Method to choose a prefix. I just mash the keyboard and add an underscore at the end.

I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.


If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.


Connect with us:

WP Learning Lab Channel: http://www.youtube.com/subscription_center?add_user=wplearninglab

Facebook: https://www.facebook.com/wplearninglab

Twitter: https://twitter.com/WPLearningLab

Google Plus: http://google.com/+Wplearninglab

Pinterest: http://www.pinterest.com/wplearninglab/

You are watching: https://youtu.be/nUa7-OHdsxg


  1. John Boyd on November 15, 2021 at 11:20 am

    Bjorn, If I use the plugin to change the db prefix, can i delete that plugin once the change has been made?

  2. Ivo N. on November 15, 2021 at 11:28 am

    The plugin does not exist anymore, rest is bad rated….

  3. A G on November 15, 2021 at 11:29 am

    Excellent video. I have to do this today for a new domain. Thanks.

  4. Naif Ali on November 15, 2021 at 11:29 am

    Hi Bjorn , Thank you for sharing this information . Could you please tell me I should change the Prefixes of Plugins Tables as well . I noticed that my plugins still have a wp_ prefix . Thanks

  5. Muhammad Sharjeel on November 15, 2021 at 11:36 am

    After updating table prefix all plugins will work normally ? I mean I installed All in one WP security and the option of change table prefix is also available in the plugin but this sentence is also written over there: " after changing table prefix might be some plugins will not work properly". So due to this reason I am asking the question about plugins working. And thanks 4 another helpful video.

  6. William SP on November 15, 2021 at 11:41 am

    Thank you!

  7. Tamás Posta on November 15, 2021 at 11:49 am

    I didn’t think it was that easy. I tried to create tables in phpmyadmin. Thanks!

  8. Erica Vang on November 15, 2021 at 11:55 am

    After I make this change with the plugin, can I deactivate it or need to keep it around to rely on the db prefix change I just did?

  9. Swami Human on November 15, 2021 at 11:59 am

    Thx, Bjorn. Very helpful. Nicely done: concise and clear. Keep up the great work:)…

    P.S. I opted in for your "THE ULTIMATE 17-POINT WordPress Pre-Launch Checklist FOR BEGINNERS" offer. Thx. I’m in your database, now:)

  10. WordPress Tutorials - WPLearningLab on November 15, 2021 at 12:00 pm

    I’ve created a playlist full of useful WordPress admin tweaks. If you want to level-up your admin dashboard check out the playlist here: https://www.youtube.com/watch?v=YhKVXC8t6DA&list=PLlgSvQqMfii6paAyNXmAEYC1cC_SkpzK9

  11. Vishay Bhatia on November 15, 2021 at 12:02 pm

    Hi, great video! I am thinking of using the plugin you mentioned to change the db prefix. However in the reviews section of the plugin there was a comment by a gentleman who sounds like he has good technical knowledge. So just wanted to get your opinion about it. His comment was:

    "We run WP_DEBUG on all our test sites 24/7. We have to because need to run our code, and our plugin code through rigorous tests and all kinds of situations.As soon as we fired this plugin up, it started popping off errors. All of these would have been easily catchable if the author had even turned on WP_DEBUG."

    So after reading this comment my fear is my site slowing down significantly.