One of Multisite’s useful features is the way it lets you change the experience users get when they first register a site on your network. You can edit their welcome email and change the default content that’s created for their site.
You do this by configuring your network settings in Settings > Network Settings.
But there are two emails that are sent out and this is the second of them. Before the site is activated, WordPress sends out an activation email with a link the user must click on in order to make their site active. Unfortunately, the settings screens don’t give you the option to edit this.
So is there a workaround? The good news is yes, you can write a plugin that amends this email. And in this post I’ll show you just how to do that.
Getting Started Customizing Your Multisite Activation Email
Before you start, you’ll need a few things:
- A development WordPress installation with Multisite activated – don’t try this on your live network until you’re happy with it.
- A code editor with FTP access, or a code editor and a FTP client.
If you still need to activate Multisite, our uptime guide to Multisite will show you how.
In this post, I’ll walk you through the code in a core WordPress file but you won’t be editing that file. Editing core file is a very bad idea: it could break WordPress and it means all your changes will be lost next time you upgrade. Instead, we’ll write a plugin that you’ll save in your site’s plugins folder and activate for your network.
The Default Email and Code
Here’s the default activation email that’s sent out when someone registers a site on your network:

The email subject is ‘Activate [link]’ where [link] is the link to the new site. All a bit uninviting, in my humble opinion!
The code that generates this is in the ms-functions.php file in the wp-includes folder of your WordPress installation. There are two filter hooks, one for the content of the email and the other for the subject.
The first is called wpmu_signup_blog_notification_email
and it lets you filter the default contents of the email itself. In the current version (3.6.1) it’s at line 820 in the ms-functions.php file:
.gist table { margin-bottom: 0; }
This uses placeholders for internationalization and it also uses variables which are defined immediately above that filter. We’ll be using the $content
variable to define the new version of the content. Each instance of n
is a line break and n%s
inserts the path to the blog. We’ll use those again in our plugin.
Note: For more on internationalization and placeholders, see our developer’s guide to internationalization.
The second filter is wpmu_signup_blog_notification_subject
, which defines the subject line of the email. Here’s the code (at line 844):
.gist table { margin-bottom: 0; }
Creating the Plugin
So now we know which filters we’ll be targeting, we can write our plugin with functions that’ll be hooked to those filters.
Create a new file for your plugin (in the wp-content/plugins folder) and give it a suitable name: I’m calling mine wpmu-ms-activation-email.php.
Add an opening to your plugin to tell WordPress what it is:
.gist table { margin-bottom: 0; }
Editing the Email Subject
First let’s create a function that defines the subject of our new version of the email.
Start by creating an empty function and hooking it to the correct filter hook:
.gist table { margin-bottom: 0; }
Now let’s populate that function. Inside the braces, add this code:
.gist table { margin-bottom: 0; }
That has some new text but it also uses the $1$s
placeholder to show the value of the network’s title, which is provided in the original file by the $from_name
variable.
Save your plugin file and we’ll move on to editing the email content.