We just raised $735,000 to introduce the world to multi-tenant WordPress.

Update the WP admin E-mail without confirmation

Want to update the WP admin E-mail for your tenants without confirmation?

One of the general WordPress settings is the “Admin E-mail”. It is the E-mail that is used for things like error reporting and verifications. To change it, the previous E-mail will have to manually agree with the change. This is unfeasible if you are creating multiple tenants a day for external clients.

To automate this process, you will have to update two options: admin_email and new_admin_email. An example snippet to run via a PHP snippets plugin is as follows:

<?php
add_action('plugins_loaded', function() {
    $new_email = 'my-email@example.com';
    update_option('admin_email', $new_email);
    update_option('new_admin_email', $new_email);
});

After activating this snippet and refreshing a WordPress page, you should see the Admin E-mail changed without requiring confirmation. This code needs to run on the site that you want to change the Admin E-mail of, likely a tenant site. That means, depending on your use case, you could use a PHP snippet plugin or a custom plugin to deploy this snippet to your tenants. You can read more about upgrading tenants here.

NOTE

In this example, the Admin E-mail is updated using the hook plugins_loaded. This is probably not the hook you will want to use. Which one you should use, however, depends entirely on your use case.

Related articles

Build a Shopify SaaS Clone using WordPress, WooCommerce, WPCS & Kubernetes

Build a WPCS Product in 5 Steps

Build a scalable WordPress SaaS or WaaS (Website as a Service

How to automate your Website as a Service (WaaS) - Storefront included!

How to automate the sale and launch of your websites using a storefront with the WPCS API, WooCommerce, and Uncanny Automator.

Webinar: Merge Sites, Automate, and the Versioning System

Merging your agency’s website portfolio in WPCS where each website has a different tech stack, automate your business with a storefront, and continuously develop your sites like a SaaS.

Getting started with the WPCS Intro Series

Launch your WordPress SaaS in 5 easy steps

Importing A Site Using the WPCS CLI

Using LocalWP to install and build our local WP installation and send it to WPCS with the CLI

Plugin name

Author

WPCS

Description

One of the general WordPress settings is the “Admin E-mail”. It is the E-mail that is used for things like error reporting and verifications. To change it, the previous E-mail will have to manually agree with the change. This is unfeasible if you are creating multiple tenants a day for external clients.

Code Snippet