Answer the question
In order to leave comments, you need to log in
How to change admin email in WordPress without confirmation?
Recently, when trying to change the E-mail address in WordPress in the settings or with a user with the Administrator role, WordPress requires confirmation:
how to disable this protection mechanism?
Someone immediately suggested replacing the E-mail address in the database, and I did it with the help of phpMyAdmin (the same can be done through the replacement plugin in the database), as a result, the E-mail really changed - everything is fine, BUT! Now it is impossible to update the information in the user profile - it constantly writes: "Sorry, this e-mail address is already in use!"
Answer the question
In order to leave comments, you need to log in
So far, I solved the problem in this way:
1) Changed the E-mail address to my own
2) Confirmed it using the link in the letter
3) Using the Better Search Replace plugin, I replaced my E-mail address in the database with the desired one
Everything works now. Information in the administrator profile is successfully updated without the message: "Sorry, this e-mail address is already in use!". Maybe I had some problem. I checked it again on pure WordPress, everything was fine from the first replacement.
Add code to functions.php.
remove_action( 'add_option_new_admin_email', 'update_option_new_admin_email' );
remove_action( 'update_option_new_admin_email', 'update_option_new_admin_email' );
/**
* Disable the confirmation notices when an administrator
* changes their email address.
*
* @see http://codex.wordpress.com/Function_Reference/update_option_new_admin_email
*/
function wpdocs_update_option_new_admin_email( $old_value, $value ) {
update_option( 'admin_email', $value );
}
add_action( 'add_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 );
add_action( 'update_option_new_admin_email', 'wpdocs_update_option_new_admin_email', 10, 2 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question