Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDaniel Fuentes
5,941 PointsCan you change the unique keys and salts, and the table prefix after you have pushed a site to go live?
If I have a site that has been published, how do I alter the keys and salts or the table prefix?
1 Answer
Dorus van der Kroft
4,982 PointsSalt keys can be changed at anytime by changing wp-config.php:
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
It should be a totally unique 60 character phrase. Luckily WordPress has a secret key generator you can use. Please do remember that all logged in users have to login again.
As for the prefix change, I would never do that on a live site because it involves renaming the tables in MySQL via a client.
The procedure would be as follows:
- Backup data (better safe than sorry)
- Rename all WordPress tables in the database: old_prefix _ tablename to new_prefix _ tablename
- Change the prefix in wp-config.php:
$table_prefix = '*new_prefix*_';