How to modify database prefix in wordpress

You can see the WordPress database prefix from wp-config.php file which is located inside the site root folder.

By default the database prefix will be wp_, one of the important reason to change this prefix is to increase the protection from hackers.

You can change it by following the below steps:

  1. Open web.config.php file from site root folder and detect below line
$table_prefix = 'wp_';
  1. Replace wp_ to your own prefix.
  2. Now log in to PHPMyAdmin and go to your WordPress database
  3. Select all the tables and click replace table prefix icon and replace it.
  4. Still, WordPress may be used the old one in few settings. So in order to fix this, you have to make necessary changes as suggested
  5. Click on SQL button in PHPMYADMINx
  6. Paste the below code and replace new prefix and oldprefix as below
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_capabilities' where meta_key = 'OLDPREFIX_capabilities';
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_user_level' where meta_key = 'OLDPREFIX_user_level';
update NEWPREFIX_usermeta set meta_key = 'NEWPREFIX_autosave_draft_ids' where meta_key = 'OLDPREFIX_autosave_draft_ids';
update NEWPREFIX_options set option_name = 'NEWPREFIX_user_roles' where option_name = 'OLDPREFIX_user_roles';

 

  1. Click on Go.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SQL server- network related or instance-specific error happened while connection establishing

  Instance-specific or network related error happening while connecting to SQL server   Please...

OleDB connection string examples

OleDB connection string examples MS Access (Jet) "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA...

Do you allow custom COM components?

Do you allow custom COM components? We are not offering to install the custom COM components...

Error when accessing a WCF services

Error when accessing a WCF services Error when accessing a WCF service: "IIS specified...

How to cache static contents to client with UseMaxAge?

You can consider to caches static contents to the client with UseMaxAge if your website has too...

Powered by WHMCompleteSolution