Sometimes the wrong content will display on a WordPress website. This can indicate that the database is pulling from the wrong tables. This article covers how to fix this by editing wp-config.php.
This is useful if the site is displaying a new install or displaying the wrong site content after importing the database.
Related Articles
Find Database Name of WordPress Site
Import WordPress Site Using Softaculous
Update Database Prefix
- Log into cPanel
- Navigate to phpMyAdmin, located in the Databases section
- Select the WordPress database
TIP: If needed, find the database name for the site. - Make note of the prefix on all the tables
EXAMPLE: In this example, the database name is imhkmc6_example and the table prefix is wpw1_. - In the cPanel, navigate to the File Manager, located in the Files section
- Navigate to the document root of the site
- Edit the wp-config.php file
- Set the
$table_prefix
value to the correct prefix for the table, including the trailing_
if there is one
EXAMPLE:$table_prefix = 'wpw1_';
- Save changes