Change WordPress Database Table Prefix

Many WordPress hosts will modify your default database table prefix when setting a site up for you. If you need to reset this to default, or would like to change it on your own, use these steps.


View Database Table Prefix

First you will want to see what your WordPress database table prefix is currently set as.

  1. Log in to the User Portal
  2. Select the environment name
  3. Click phpMyAdmin
  4. Select the database name
  5. In the center of the page you will see a list of database tables
    • Normally each table (users, usermeta, options, posts, etc) begins with wp_
    • In this example you will see the database tables begin with test_
    • This means the wp-config.php file must also list the database table prefix is as test_ and not the default entry of wp_

Log in via SFTP

  1. Access your website’s files using SFTP
  2. Locate in the root of your site, the file called wp-config.php
  3. Open wp-config.php in your favorite text editor

Edit wp-config.php

Once the file is opened in your text editor, towards the top, you will see this line:

$table_prefix = 'wp_';

Change this line to reflect your table prefix. For example, if your table prefix was test_ you would change the line of code to this:

$table_prefix = 'test_';

NOTE: Don’t forget the underscore _ at the end of the prefix!

Once you save the file, you will have successfully edited your table prefix.


NEXT STEP: Learn how to run SQL queries on your database

Still need help? Contact support!

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best in WordPress hosting.

See why more customers prefer WP Engine over the competition.