When creating a new user on WordPress multisite there is a Skip Confirmation Email
checkbox that is unchecked by default. This unchecked box results in a user being added to a temporary “signups list” when they are added to the site. The user is not fully added to the site until they complete the confirmation steps in the email they receive. For many sites, it is preferable to check this Skip Confirmation Email
when adding a user.
Check “Skip Confirmation Email” by Default
This plugin, when activated on a multisite WordPress installation, will make this checkbox checked by default.
https://wordpress.org/plugins/skip-confirmation-on/
Note: This plugin also changes “Send User Notifiction” to unselected by default on WordPress single site.
In standard WordPress, the tickbox “Send User Notifiction” is ticked by default (so a message is sent). The plugin changes this to unticked by default (so a message is NOT sent).
Code Solution
Before I came upon the above plugin, I was playing around with code and found the following will deliver the same checked by default behavior for Skip Confirmation Email
on the Add User page.
add_action(
'admin_enqueue_scripts',
function() {
if (
! is_multisite() ||
'user' !== (get_current_screen())->id
) {
return;
}
wp_add_inline_script(
'wp-ajax-response',
'document.querySelectorAll(\'input[name="noconfirmation"]\').forEach((checkbox) => checkbox.checked = true);'
);
}
);
Leave a Reply