AI Verified
Change admin email without sending verification emails
This code snippet allows you to change the admin email setting in WordPress without requiring outbound email verification. This functionality was removed in WordPress v4.9, and this snippet restores it, enabling admins to update the admin email address without needing the recipient to confirm the change via email. Features: Remove Pending Email Changes: Clears any pending email changes that might have been set before activating this snippet, ensuring that the new email is set without any pending confirmation. Disable Outbound Email for Admin Email Change: Disables the email that WordPress usually sends to the old admin email address when the admin email is changed. Verify Nonce for Security: Checks a security nonce before allowing the email change, ensuring that the request is legitimate. Admin Notices: Displays admin notices to provide feedback on actions taken, such as successfully sending a test email. Modify Options-General.php Page: Modifies the admin settings page to remove the message about email confirmation and add a "Test Email" button for verifying the new admin email. AJAX Integration for Test Email: Uses jQuery to add the "Test Email" button functionality, allowing admins to test the new email address without saving it.
PHP
Voted: 0 by 0 user(s)
Add the Snippet: Use the Code Snippets Pro plugin to add this snippet to your WordPress site. Activate the Snippet: Activate the snippet to enable its functionality. Update Admin Email: Go to the "General Settings" page in your WordPress admin area to change the admin email without outbound email verification. Use the "Test Email" button to ensure the new email address is correct.
Scroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: 6.4
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
Free & Pro
Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.
Pro Only (Coming Soon)
You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.
Last modified:
16/07/2024
This snippet has the following status:
AI Verified
This snippet has been tested by our AI bot, see any comments below.
AI Bot Comments:
Potential vulnerability found : Cross Site Scripting
Found on line : 91
Code : echo("<div class='notice {$noticeLevel} is-dismissible'><p>{$message}</p></div>")
Vulnerable line : 90
Code : $noticeLevel = !empty($option['notice-level']) ? $option['notice-level'] : 'notice-error');
Potential vulnerability found : Cross Site Scripting
Found on line : 91
Code : echo("<div class='notice {$noticeLevel} is-dismissible'><p>{$message}</p></div>")
Vulnerable line : 89
Code : $message = isset($option['message']) ? $option['message'] : false);
Potential vulnerability found : Insecure E-mail
Found on line : -1
Code : mail(= $_POST['new_admin_email'])
Found 3 vulnerabilities
0
Please see some snippets below related to this snippet..
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
This code will redirect a specific page based on the user role NOT being met.
WordPress Admin
AI Verified
Added: 11 months ago
Last Updated: 11 months ago
When using Code Snippets 3.6.0 or later, use this snippet to prevent the automatic scroll-to-top after clicking 'save' when editing a snippet.
WordPress Admin
AI Verified
These are some popular snippets from this users codevault..
WordPress Admin
AI Verified
WordPress Admin
AI Verified
Added: 6 months ago
Last Updated: 6 months ago
I wanted a way for my clients to have a one click "Clear Bunny CDN" without having to go into other settings. Worked with AI and BunnyCDN support on this.
General
AI Verified
Category
Snippet Status