Changing the wp db prefix after installation?

I have nearly completed a project but forgot in the first place to change the wp_ db prefix on install. Now i am a little bit worried to change it afterwards in fear of breaking the whole installation. Therefor the question if these described methods still work with 3.8.x or has anything change since then?

http://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/

http://digwp.com/2010/10/change-database-prefix/

and have only table and field names to be changed? cuz i also saw a few prefixes starting with wp instead of wp_ ? Best regards Ralf

2 s
2

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