L
L
Leonid2018-02-20 13:22:06
Email
Leonid, 2018-02-20 13:22:06

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:
gSAn1On8QpGyI0e0KrPTRA.png
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

3 answer(s)
L
Leonid, 2018-02-20
@easycode

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.

O
Orkhan Hasanli, 2018-02-20
@azerphoenix

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 );

Change email and remove code.

M
Maksym Davydchuk, 2018-02-20
@maksym1991

You need to change the database, wp_options table
5a8bfdc2412bc178569980.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question