public
Last active

Remove non-public user data from standard WP database.

  • Download Gist
wp-anonomize-user-data.sql
SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-- 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';

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.