WPProAtoZ Email & IP Guardian
Easily toggle outgoing WordPress emails on or off with a simple checkbox, complete with a customizable admin notice when emails are disabled.
by WPProAtoZ.com / John Overall · github.com/ahkonsu/wpproatoz-turn-off-wpmail · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ahkonsu/wpproatoz-turn-off-wpmail/archive/refs/heads/main.zipDeclares an update source (https://github.com/Ahkonsu/wpproatoz-turn-off-wpmail/releases), so updates arrive through the plugin's own updater.
Readme
___ _ _
/ _ \| | | |
/ /_\ \ |__ | | _____ _ __ ___ _ _
| _ | '_ \| |/ / _ \| '_ \/ __| | | |
| | | | | | | < (_) | | | \__ \ |_| |
\_| |_/_| |_|_|\_\___/|_| |_|___/\__,_|
\||/
| @___oo
/\ /\ / (__,,,,|
) /^\) ^\/ _)
) /^\/ _)
) _ / / _)
/\ )/\/ || | )_)
|(,,) )__) || / \)___)\ | \____( )___) )___ \______(_______;;; __;;;=== WPProAtoZ Email & IP Guardian === Contributors: WPProAtoZ.com Tags: email, wp_mail, disable email, ip restriction, admin notice, development, cidr Requires at least: 6.0 Tested up to: 6.7.2 Stable tag: 1.9.2 Requires PHP: 8.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html A lightweight plugin to toggle outgoing WordPress emails and restrict site access by IP, perfect for development and testing environments.
== Description ==
WPProAtoZ Email & IP Guardian is a lightweight plugin designed for developers and site administrators who need to manage outgoing emails and site access in WordPress. With a simple settings page under "Settings" > "IP & Email Controls", you can disable all emails sent via wp_mail() and restrict site access to specific IPs or IP ranges using .htaccess. Ideal for development, staging, or testing environments, this plugin prevents unwanted emails and unauthorized access with minimal configuration.
Key features:
- Disable all outgoing emails with a single checkbox.
- Customize the admin notice displayed when emails are disabled (default: "THIS DEV SITE HAS NO OUTGOING MAIL Mail from wp_mail() has been disabled for this site.").
- Log blocked emails to debug.log when WP_DEBUG is enabled.
- Test email functionality with a built-in button.
- Restrict site access to allowed IPs or IP ranges via
.htaccess. - Dynamic IP management with add/remove functionality and optional notes.
- CIDR notation support (e.g., 192.168.1.0/24).
- Uses both
wp_mailfilter andphpmailer_initfallback for reliable email blocking. - Documentation tab for easy updates via external HTML file.
No need to edit core files or wp-config.php—everything is managed through an intuitive settings page.
== Installation ==
- Upload the
wpproatoz-email-ip-guardianfolder to the/wp-content/plugins/directory, or install the plugin directly through the WordPress plugins screen. - Activate the plugin through the 'Plugins' menu in WordPress.
- Navigate to Settings > IP & Email Controls to configure the plugin.
== Usage ==
- Go to Settings > IP & Email Controls in your WordPress admin dashboard.
- Email Settings:
- Check "Disable Outgoing Emails" and save to stop all emails. A customizable admin notice will appear.
- Adjust the "Custom Notice Text" field (optional) and "Notice Background Color".
- Enable "Log Blocked Emails" to track blocked emails in debug.log (requires WP_DEBUG).
- Click "Send Test Email" to test email functionality.
- IP Restriction Settings:
- Check "Enable IP Restriction" to limit site access to listed IPs. Your current IP is auto-added.
- Add or remove IPs/ranges/CIDRs (e.g., 192.168.1.1-192.168.1.10 or 192.168.1.0/24) in the "Allowed IPs" section, with optional notes.
- Save changes to update
.htaccess.
- To revert, uncheck the respective options and save.
- Switch to the Documentation tab for guides and updates (loads from
documentation.htmlin the plugin directory).
Tested with common email triggers (e.g., password resets, registrations) and IP restrictions on Apache servers.
== Frequently Asked Questions == = Why would I want to disable outgoing emails? = Useful in development or staging environments to prevent test emails from reaching real users.
= Can I customize the admin notice? = Yes, enter custom text and choose a background color in the settings. Defaults apply if left blank.
= Does this block all emails? =
Yes, it blocks all wp_mail() emails using a filter and phpmailer_init fallback for reliability.
= What happens when emails are disabled? =
Emails are silently blocked, and wp_mail() returns as if successful, avoiding plugin errors.
= Can I see which emails were blocked? = Enable "Log Blocked Emails" to log details to debug.log (requires WP_DEBUG).
= How does IP restriction work? =
It writes rules to .htaccess to allow only specified IPs/ranges/CIDRs, blocking all others.
= Does it support IP ranges or CIDR? = Yes, enter ranges like "192.168.1.1-192.168.1.10" or CIDRs like "192.168.1.0/24" in the Allowed IPs section.
= What are IP notes for? = Optional labels (e.g., "Office VPN") to track what each IP is for—doesn't affect restrictions.
= How do I update documentation? =
Edit documentation.html in the plugin directory; changes load on page refresh.
== Screenshots ==
- The settings page under "Settings > IP & Email Controls" with email and IP options.
- The admin notice displayed when outgoing emails are disabled (default or custom).
- IP list with notes and CIDR example.
== Changelog == = 1.9.2 =
- Fixed typo error in documentation.html file = 1.9.1 =
- Fixed initial .htaccess write for IP restrictions on first enable.
- Added CIDR notation support (e.g., 192.168.1.0/24) for efficient IP ranges.
- Added optional notes field for each allowed IP entry, with balanced UI layout.
- Added Documentation tab to settings page, loading from documentation.html for easy updates.
= 1.9 =
- Renamed plugin to "WPProAtoZ Email & IP Guardian" for better branding.
- Added "Settings" link to plugin listing for quick access.
- Updated text domain and
.htaccessmarker to reflect new name.
= 1.8-beta =
- Added IP restriction feature with dynamic IP/range management via
.htaccess. - Enhanced email blocking with dual-layer approach (
wp_mailfilter andphpmailer_init).
= 1.7 =
- Adjusted plugin name consistency and minor tweaks.
= 1.6 =
- Added screenshot to documentation.
= 1.5 =
- Introduced customizable admin notice text with a default fallback.
= 1.4 =
- Added
phpmailer_initfallback for reliable email blocking. - Fixed issue where emails were sent in some edge cases.
= 1.3 =
- Modified
wp_mailfilter to returnfalsewhen emails are disabled.
= 1.2 =
- Resolved infinite recursion by switching to
wp_mailfilter from pluggable function.
= 1.1 =
- Added admin notice that toggles with email disable setting.
= 1.0 =
- Initial release with basic email toggle functionality.
== Upgrade Notice == = 1.9.1 = Update for enhanced IP features (CIDR, notes), fixed initial setup, and new Documentation tab.
= 1.9 = Update for a new name, improved branding, and a convenient "Settings" link in the plugin listing.
= 1.8-beta = Major update adding IP restriction features—test thoroughly in a staging environment.
= 1.5 = Adds customizable notice text—update to personalize your admin experience!
== License == This plugin is licensed under the GPLv2 or later. You are free to use, modify, and distribute it as per the license terms.
== Credits ==
Developed with assistance from xAI’s Grok for debugging and optimization.
Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| v1.9.2 | Sep 23, 2025 |
| v1.9.1 | Sep 13, 2025 |
| v1.9 | Apr 9, 2025 |
| v1.7 | Mar 26, 2025 |
| v1.6 | Mar 10, 2025 |
| v1.5 | Mar 10, 2025 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.