Changing the wp db prefix after installation?

The basic idea should work– change the prefix in both wp-config.php and in the database itself. What isn’t covered would be cases where the prefix is used in other contexts such as when used as part of a “meta” key. Those cases you would need to trace down one by one.

You could also have trouble it the prefix has been hard-coded into anything, but hopefully that isn’t the case.

The safe thing to do, if you are able would be to copy the entire database to a database with a different name, and alter the second database. Switching between the two would be a simple edit of the database name in wp-config.php and you would have nearly no chance of data loss if you make a mistake, just make sure no one is editing the site while you play with it.

I’d download a complete backup of the site to disk, just to be 100% safe.

Leave a Comment