Change WP Database Prefix

  1. Change prefix in wp-config.php
  2. Change prefix in phpMyAdmin
  3. Run sql query below to update fields in wp_options and wp_usermeta tables
UPDATE `newprefix_options` SET `option_name`=REPLACE(`option_name`,'wp_','newprefix_') WHERE `option_name` LIKE '%wp_%';
UPDATE `newprefix_usermeta` SET `meta_key`=REPLACE(`meta_key`,'wp_','newprefix_') WHERE `meta_key` LIKE '%wp_%';

Leave a Reply

Your email address will not be published.