How to change main admin email address in WordPress without notification and confirmation processes

36,723

Solution 1

There is a 'secret' settings page which lets you change all of the settings in the options table.

Access it by changing the URL from /options-general.php to /options.php

Solution 2

There are few ways to change admin email without using a 3rd party plugin.

Also, besides admin_email, there is another value that needs to be changed. No matter that you change admin_email value in DB, a confirmation notice will remain, unless you change new_admin_email too.

Updating via the database:

In case of updating option via DB directly, there are two options that need to be changed: admin_email and new_admin_email.

UPDATE wp_options SET option_value = '[email protected]' WHERE 
option_name LIKE 'admin_email' 
OR 
option_name LIKE 'new_admin_email';

note: While by default every WordPress database has wp_ prefix for its tables, they can be changed, so check in wp-config.php for $table_prefix value.

Updating via options.php:

Another way without the use of some plugin is as mentioned accessing secret page /wp-admin/options.php. However, there might be too many options, and due to a number of $_POST variables limit set for each server differently, having it quite impossible to change it that way.

See more about max_input_vars https://www.php.net/manual/en/info.configuration.php

Updating via functions.php in active theme:

You could set one time code (and delete it after) in functions.php of your active theme to update these options:

update_option( 'admin_email', '[email protected]' );

and

update_option( 'new_admin_email', '[email protected]' ); 

Put these within some admin_init action callback.

Updating via wp-cli:

Another way to update Admin email is via wp-cli ( if you have access to terminal ssh):

wp option update admin_email '[email protected]'

and

wp option update new_admin_email '[email protected]'

see more about wp option commands:

https://developer.wordpress.org/cli/commands/option/update/

Solution 3

The one that you are trying to replace is actually the email in Wordpress settings, not the wp user email. That one can be changed directly in database in the table wp_options where option_name is admin_email

Or with the given update query:

UPDATE `wp_options` SET `option_value` = '[email protected]' WHERE `option_name` = 'admin_email';

Solution 4

Note: Get dump and try it on local first. Don't test in production.

Change with DB

//email
UPDATE `wp_users` SET `user_email` = "new_email_address" WHERE `wp_users`.`user_login` = "admin";

//password
UPDATE `wp_users` SET `user_pass` = MD5('new_password_here') WHERE `wp_users`.`user_login` = "admin";

Check This too

Solution 5

The network admin email is changed from wp_sitemeta table. Use following query in phpmyadmin or any mysql client in order to update the email if you are unable to change from network admin settings.

UPDATE `wp_sitemeta` SET `meta_value` = '[email protected]' WHERE `meta_value` = '[email protected]';

Note: please use the table prefix accordingly used in db if it is not wp in your case.

look at the image of wp_sitemeata table if you want to know the entries to be changed.

Share:
36,723
developerme
Author by

developerme

WordPress themes and plugins Developer And also woocommerce developer. Learning a lot from the guys and gals out here. Email : [email protected]

Updated on October 19, 2021

Comments

  • developerme
    developerme over 2 years

    I have created one site in staging server I want to change admin email address for that staging site. Because I want to test something on staging site at that time, and I want that no email is being sent to client (original admin email), I want to change main admin email.

    But when I change admin email I get confirmation link on to my new admin email address.

    The Admin email address won’t change until I click on the link in the confirmation email.

    After I click on the confirmation link, the original admin is receiving notice of Admin Email Change.

    I want to disable notice of Admin Email Change and also new Admin Email Address confirmation link in WordPress.

    How I do that? Could you please help me? Is there any code for this?

    enter image description here

  • Bilal Ahmed
    Bilal Ahmed over 6 years
    he mention in comments that i have no access of DataBase
  • Abdulla Nilam
    Abdulla Nilam over 6 years
    That was not in question and it added parallelly while I'm adding answer
  • developerme
    developerme over 6 years
    @BilalAhmed That was my doubt if have no access how i do that?
  • developerme
    developerme over 6 years
    I think this query only changing admin login email id.
  • Abdulla Nilam
    Abdulla Nilam over 6 years
    @developerme as you asked How to change Admin email address change email only
  • developerme
    developerme over 6 years
    I found that admin email in database in wp_option table.On wp_option table there we can see that admin_email option that area we need to change
  • Clinton
    Clinton about 6 years
    Very nice, thank you. This should be the selected answer.
  • developerme
    developerme almost 6 years
    Great Answer Thanks a lot!
  • Kai Qing
    Kai Qing almost 6 years
    I've been working with WP for like 8 solid years and I never knew about this page. Awesome! You'd be surprised how many admin emails I get cause the new owners just refuse to change the site admin and that stupid email confirmation block prevents me from doing it for them. Never again! You spared me endless harassment in ancient site notifications.
  • Kali
    Kali almost 6 years
    Thank you sooooooooooooooooo much
  • Usce
    Usce over 5 years
    This is not working anymore, I've tried, saved changes, bot back to options-general and notification of pending mail was there.
  • sMyles
    sMyles over 5 years
    This is the best answer as options.php does not always save/work correctly
  • Daniel Hansen
    Daniel Hansen over 5 years
    Works for me on 5.1.1. There are two fields to change: 'admin_email' and 'new_admin_email'
  • Dan
    Dan over 4 years
    So there is always a new_admin_email? and it will be the same as admin_email once confirmed via the UI?