Change the WordPress admin email when the old inbox is unreachable

If the mailbox for your old admin address is gone – a domain lapsed, a provider closed, the mailbox deleted – the Settings → General path for changing the Administration Email can’t finish. WordPress won’t commit the change until someone clicks a confirmation link that core sends to the new address, and the site has to send that message through its own mailer. If the site can’t send mail at all, or the configured sender is pointing at the dead domain, the link never arrives and the admin stays locked to the old value. Three ways around it, depending on what you can still reach on the site.

Why the stock path collapses

The Settings → General form field is literally named new_admin_email. Saving the page writes the proposed address straight into wp_options.new_admin_email, which fires the update_option_new_admin_email hook in wp-admin/includes/misc.php; the hook stores a validation array in a second option called adminhash and sends a confirmation link to the new mailbox via wp_mail(). The live admin_email only changes once the recipient clicks that link (core: update_option_new_admin_email).

The confirmation message itself goes out through wp_mail(), which on a stock install hands off to PHP mail(). The default From is wordpress@<host>, where <host> is derived from network_home_url() with any leading www. stripped.

The lockout then comes from one of two mechanisms, both ending at the same outcome:

  • No SMTP plugin configured. PHP mail() on shared and budget VPS hosts is routinely dropped, either at the host MTA or by the receiver’s SPF/DKIM check against the sending host. The Return-Path is undeliverable; no bounce surfaces anywhere.
  • An SMTP plugin with “Force From” pointed at admin_email. WP Mail SMTP, FluentSMTP, and Post SMTP each expose a “Force From” toggle that rewrites the From header on every outgoing message to a configured address, and the default for that field is admin_email – the dead .co.uk in this case. The sending provider then either rejects outright or the receiver’s DMARC check fails against the From domain and the message is binned.

Either way the link never lands; the fix is to skip the confirmation flow and write the values directly.

Bypass 1: WP-CLI

The cleanest path if you have SSH, or your host exposes a WP-CLI console (SpinupWP, Kinsta, WP Engine, Cloudways, and most managed hosts do):

wp option update admin_email [email protected]
wp option delete new_admin_email adminhash

The second line clears both pending-state options the Settings → General flow writes together: new_admin_email carries the proposed address and drives the admin-notices banner at the top of wp-admin, while adminhash holds the token the confirmation link validates against. Deleting only the first leaves an orphan hash row that a reader checking the DB later will wonder about.

If the WordPress user account itself was tied to the old mailbox – a separate value in wp_users.user_email from the site-wide admin_email – update that too. Find the admin’s user ID first:

wp user list --role=administrator --fields=ID,user_login

then:

wp user update <user-id> [email protected] --skip-email

--skip-email suppresses the “Notice of Email Change” notification that WordPress would otherwise send to the previous address (WP-CLI: wp user update). Without it, WordPress sends that notice to the old mailbox.

Bypass 2: direct database write

If you only have database access (phpMyAdmin, Adminer, your host’s DB console), three rows need touching. The table prefix on your site may not be wp_; check $table_prefix in wp-config.php first.

UPDATE wp_options SET option_value = '[email protected]' WHERE option_name = 'admin_email';
DELETE FROM wp_options WHERE option_name IN ('new_admin_email', 'adminhash');
UPDATE wp_users SET user_email = '[email protected]' WHERE ID = <admin-user-id>;

Both pending-state options go in one DELETE. To find the admin’s user ID:

SELECT ID, user_login FROM wp_users WHERE user_login = 'yourlogin';

Widen the WHERE clause to list every admin if you aren’t sure which account is the primary one. After writing, clear any object cache (Redis, Memcached, or the host’s built-in caching layer): admin_email is loaded via wp_load_alloptions() and cached across requests, so a stale value will linger until the cache is flushed.

Bypass 3: a one-shot mu-plugin

If you only have SFTP – no SSH, no DB console – drop a file at wp-content/mu-plugins/force-admin-email.php (create the mu-plugins/ directory first if it doesn’t exist):

<?php
update_option( 'admin_email', '[email protected]' );
delete_option( 'new_admin_email' );
delete_option( 'adminhash' );
unlink( __FILE__ );

Must-use plugins run automatically on every PHP-executed request, so loading any page on the site runs the four lines and removes the file. The unlink( __FILE__ ) is deliberate: the file deletes itself, so you don’t have to remember to clean it up afterwards. (A full-page cache doesn’t change this – mu-plugins only run on PHP-executed requests, and one such request is enough.)

If the WordPress user also needs an update, add it before the unlink:

add_filter( 'send_email_change_email', '__return_false' );
wp_update_user( [ 'ID' => 1, 'user_email' => '[email protected]' ] );

The filter suppresses the “your email changed” notice that would otherwise go to the old mailbox. Set ID to match the admin account – usually 1 on a site set up by a single admin from the start, but confirm from Users → All Users (the numeric ID appears in each row’s edit-link URL) before trusting it.

After the change: the From address

Updating admin_email fixes the Settings → General value and clears the lockout. It doesn’t necessarily fix the From header on outgoing mail. Two cases:

  • No SMTP plugin. WordPress derives the default From from the host portion of network_home_url() (prefixed wordpress@, www. stripped). Once the site’s canonical URL is on the new domain, outgoing mail should align – confirm by sending a test and checking the From and Return-Path headers.
  • An SMTP plugin with a configured From override. WP Mail SMTP, FluentSMTP, and Post SMTP each hold their own From address and “Force From” toggle, independent of admin_email – update them there, not just at the site level. How to change the From address on WordPress email walks through the override chain in detail.

If the new domain hasn’t been authenticated at the sending provider yet – no SPF include, no DKIM record, no verified sender identity – delivery will fail even once the From is right. DNS records for WordPress email covers that side.