Anonomize Non-Public WordPress User Data

If you need to remove non-public user data from a WordPress database, these SQL queries should do the trick for you:


— generic email addresses and new passwords for users
UPDATE wp_users
SET user_email = CONCAT(user_login, '@example.com'),
user_pass = MD5(CONCAT(RAND(), CAST(ID AS CHAR), user_login));
— generic email addresses for commentors
UPDATE wp_comments
SET comment_author_email = CONCAT(CAST(comment_ID AS CHAR), '@example.com');
— admin email address
UPDATE wp_options
SET option_value = 'admin@example.com'
WHERE option_name = 'admin_email';

Note that if you have plugins, etc. that store additional user data in user meta you might need to clear those out as well.