For the purposes of this post let’s assume that you’ve setup an instance of WordPress Multisite, there are a handful of sites (termed blogs), you’re the super admin, and there are different administrators per site. What if one of the site administrators wants to add a new user to their site? Easy enough, they can go to Users > Add New and enter a new username and email address and create a new user account. The problem is, since they’re not a super admin, this doesn’t actually create an account but rather merely create a new user signup and send them an invitation via the provided email address. The new user must then click a link within the email to accept the invitation, which actually creates the user account. Worse yet, this invitation email isn’t easily editable within the Network Admin > Settings > Network Settings, but rather only via a WordPress filter hook. This sort of workflow may make sense for a true blog site, but what about a business site where user accounts are used to manage staff bios and the web content manager needs to add or remove dozens of users? This is what I would call a hassle! It may not be the solution for everyone, but one solution is to disable the new user invitation email and automatically activate the new user signup.
The benefit to this is that web content managers no longer need to hassle people to check their email to activate their user account, and as soon as a new user is created the user account will show up in the list of users. Also the person will receive the standard “Welcome User Email” immediately after the new user account is created, which by default includes the username and password needed to login.
Thankfully, due to the power of WordPress filter hooks this is an incredibly easy solution to implement. However, since this is intended to be used across the entire WordPress network it is best to create a Must-Use Plugin, or a regular plugin that is Network Activated.
<?php /* * Plugin Name: Disable User Invitation * Plugin URI: http://laubsterboy.com * Description: Disables WordPress Multisite user invitations by automatically submitting the activation key and preventing the email from sending. * Version: 1.0.0 */ /** * Halts the user signup process (where a user would receive an email to activate their account) * and instead automatically activates the account and sends the user welcome email (template * set in network settings). This was done so that site Administrators could create new user * accounts, at the blog level, and bypass the need for the user to activate the account. * * @since 1.0.0 * * @param string $user The new users username. * @param string $user_email The new users email address. * @param string $key The user activation key, needed to create the user account from the "signup" table * @param array $meta User meta. * @return boolean */ function laubsterboy_signup_user_notification($user, $user_email, $key, $meta) { // Manually activate the newly created user account wpmu_activate_signup($key); // Return false to prevent WordPress from sending the user signup email (which includes the account activation link) return false; } add_filter('wpmu_signup_user_notification', 'laubsterboy_signup_user_notification', 10, 4); ?>
This is the kind of plugin that I assumed was a built-in feature of WP multisite. I now know better so, having found this post, am wondering how to acquire this kind of plugin. Does it exist already, or were you talking about building it?…
looking forward to reply…
Hi, Bailey. I too assumed that this functionality would be baked into WP multisite, but for whatever reason it’s not. I’m not aware of any plugins that provide this functionality, but the code in the post actually is a complete plugin and can be copied into a new php file and then placed in your WP wp-content/plugins directory and then activated in the Network Plugins screen. Keep in mind it will have no settings or options, but if activated it will prevent user activation emails from being sent and will also automatically create the user account.
Thank you, thank you, thank you. This works great!
Huge thanks for this! This is the exact set up I needed and had been struggling with the filters to make it happen on my own. Thanks again!
This does not work any more, tried on a fresh wp MU install .
any update ? thank you
Hi, Ben. Nothing has changed with the filter in the WordPress core code. How are you adding the code to your MU install? Are you using an mu-plugin, a regular plugin, adding it to your theme functions.php, or some other way? I ask because it must be added in such a way that the code is run across the network/site, so it’s ideally put into an mu-plugin or a regular network activated plugin.
Hi, just adding into functions.php
ok I understand now, Will add it as a Mu plugin.
I let you know
I came to this site with the introduction of a friend around me and I was very impressed when I found your writing. I’ll come back often after bookmarking! baccarat online
Have you been searching to buy pain medication online at good prices? However, meds pluggings is the best online pharmacy for you to buy your medication online cheap and legit. Moreover, with our 100% success rate and fast delivery, your order is 100% sure, safe and guarantee.
Also, delivery of your package within the USA takes 24 hours, 2 days to Canada and Europe, and three to five days worldwide. Finally, in Ideal medical pharmacy, you’ll order you medication online within the USA, Canada, Australia, UK, Europe, and Worldwide.
For more info, contact:
Website: https://medspluggings.org/
Phone N0: +1(213) 214-0423
At Just Med USA, we are one of the leading suppliers of pain pills
in the industry. You can order Adderall online from us by simply adding it
to the cart and proceeding to checkout.
Website:https://www.justmedusa.com/
Email:pharmaus505@gmail.com
Text : +1 (401) 281-7683