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:
- Open web.config.php file from site root folder and detect below line
$table_prefix = 'wp_';
- Replace wp_ to your own prefix.
- Now log in to PHPMyAdmin and go to your WordPress database
- Select all the tables and click replace table prefix icon and replace it.
- 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
- Click on SQL button in PHPMYADMINx
- 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';
- Click on Go.