Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/noushadnipun/forminator-email-domain-blocker-wp-plugin/archive/refs/heads/master.zipA powerful WordPress plugin that blocks specific email domains and specific email addresses from submitting Forminator forms. Manage a blacklist of unwanted domains and individual addresses directly from your WordPress admin panel with ease and flexibility.
Overview
Forminator Email Domain Blocker is a lightweight, efficient plugin designed to enhance security and control over your Forminator forms by preventing submissions from specific email domains or specific email addresses. Whether you want to block spam, test domains, individual troublemakers, or unwanted external addresses, this plugin provides a simple yet effective solution.
Features
Key Features:
- Easy Domain Management – Add or remove blocked email domains from a user-friendly admin interface
- Easy Email Management – Add or remove blocked individual email addresses from the same admin interface
- Multiple Domain & Email Support – Block unlimited domains and email addresses with a simple list format (one entry per line)
- Case-Insensitive Matching – Automatically handles uppercase and lowercase domains and emails
- Smart Domain Validation – Built-in validation automatically cleans up pasted domains
- Removes accidental protocols (http://, https://)
- Strips path segments if included
- Validates proper domain format
- Smart Email Validation – Built-in validation using WordPress's native email checks, so only properly formatted addresses are saved
- Exact Domain Matching – Blocks all emails from a domain (e.g., blocking
example.comblocksuser@example.com,admin@example.com, etc.) - Exact Email Matching – Blocks one specific address only (e.g., blocking
john@example.comblocks only that address, leaving the rest ofexample.comuntouched) - Priority Checking – Exact email matches are checked before domain matches, so specific-address rules always take effect
- Targeted Field Validation – Focuses on the "email-1" field in Forminator forms
- Clean Error Messages – Users receive clear feedback when their email or domain is blocked, and the message tells them which type of rule matched
- Deduplication – Automatically removes duplicate entries from both the domain list and the email list
- Safe Uninstall – Cleanly removes all plugin data (both domain and email lists) when uninstalled
- Lightweight & Fast – Minimal performance impact on your WordPress site
- Internationalization Ready – Fully translatable (Text Domain:
forminator-email-domain-blocker)
Requirements
System Requirements
- WordPress version 5.0 or higher
- PHP version 7.4 or higher
- Forminator Plugin (version 1.0 or higher) – Must be installed and activated
Browser Compatibility
- Modern web browsers (Chrome, Firefox, Safari, Edge) for admin interface
- No JavaScript requirements for form blocking
Installation
Step 1: Upload the Plugin
- Download the plugin folder
forminator-email-domain-blocker - Upload it to
/wp-content/plugins/on your WordPress installation - Alternatively, use WordPress admin → Plugins → Add New → Upload Plugin
Step 2: Activate the Plugin
- Navigate to Plugins in your WordPress admin dashboard
- Find "Forminator Email Domain Blocker" in the list
- Click Activate
Step 3: Configure Blocked Domains & Emails
- Go to Settings → Forminator Email Blocker
- Under Blocked domains, enter one domain per line (e.g.,
example.com) - Under Blocked email addresses, enter one full email per line (e.g.,
john@example.com) - Click Save Changes
Usage
Adding Blocked Domains
- Navigate to Settings → Forminator Email Blocker in your WordPress admin
- In the Blocked domains textarea, enter domains you want to block, one per line:
example.com spam.com test.com - The plugin automatically:
- Converts domains to lowercase
- Removes duplicate entries
- Strips protocols and paths if accidentally pasted
- Validates proper domain format
Adding Blocked Email Addresses
- In the same settings page, find the Blocked email addresses textarea
- Enter full email addresses you want to block, one per line:
john@example.com spammer@gmail.com noreply@competitor.com - The plugin automatically:
- Converts emails to lowercase
- Removes duplicate entries
- Validates proper email format (invalid entries are silently dropped)
- Use this when you want to block one person, not their entire domain — for example, blocking
john@gmail.comwithout blocking every other@gmail.comaddress.
Example Scenarios
Blocking Spam Domains:
gmail.com
yahoo.com
domain-known-for-spam.com
Blocking a Specific Troublemaker Without Blocking Their Whole Domain:
troublemaker@gmail.com
Blocking Test/Development Domains:
test.com
dev.com
localhost.local
Blocking Competitor or Unwanted Domains/Addresses:
competitor.com
sales@competitor.com
How It Works
| Aspect | Detail |
|---|---|
| Target Field | email-1 (the default email field in Forminator) |
| Match Types | Exact email match (checked first) and exact domain match (checked second) |
| Case Sensitivity | Case-insensitive for both domains and emails |
| Behavior | Blocks form submission and shows an error message |
| Error Message | Dynamically states whether the specific address or the whole domain was blocked |
Examples
- ✅ Block
example.com→ Blocksuser@example.com,admin@example.com,test@example.com - ✅ Block
john@example.com→ Blocks onlyjohn@example.com;jane@example.comstill works - ✅ Multiple domains/emails → Each entry is evaluated independently
- ✅ Duplicate entries → Automatically removed and deduplicated
- ✅ Format variations → Normalized to lowercase
- ✅ Overlapping rules → If an address matches both an email rule and a domain rule, the email-specific message is shown
Configuration
Admin Settings Page
Location: Settings → Forminator Email Blocker
Options:
- Domain List (textarea)
- Enter one domain per line
- Domains are automatically validated and cleaned
- Duplicates are automatically removed
- Supports newline variations (CR, LF, CRLF)
- Email List (textarea)
- Enter one full email address per line
- Emails are validated using WordPress's built-in email checks
- Duplicates are automatically removed
- Supports newline variations (CR, LF, CRLF)
Frequently Asked Questions (FAQ)
Q: Will this block subdomain emails too?
- A: No. The plugin uses exact domain matching. Blocking
example.comwill NOT blockmail.example.com. You must add each domain separately.
Q: Can I block just one person instead of their whole domain?
- A: Yes. Add their full address (e.g.,
john@example.com) to the Blocked email addresses list instead of the domain list. Only that exact address will be blocked.
Q: What happens when a blocked domain or email tries to submit?
- A: The form submission is rejected with an error message naming the specific blocked email or domain, e.g., "Invalid Email address, the address 'john@example.com' is not allowed." or "Invalid Email address, emails from the domain 'example.com' are not allowed."
*Q: Can I block wildcard domains like `.example.com`?**
- A: Currently, the plugin uses exact domain matching. Wildcard matching is not supported in this version.
Q: What if an address matches both a blocked email and a blocked domain?
- A: The exact email match takes priority, and the error message will reference the specific email address.
Q: Does this affect other plugins or email functionality?
- A: No. The plugin only targets Forminator forms and specifically the "email-1" field. It doesn't affect WordPress email sending or other plugins.
Q: How do I know if a domain or email is blocked?
- A: Visit Settings → Forminator Email Blocker and check both the domain list and the email list.
Q: Can I block multiple domains and emails at once?
- A: Yes. Add as many domains and email addresses as you need, one per line in their respective lists.
Q: Will blocking a domain or email affect existing form submissions?
- A: No. Blocking only applies to new submissions after the domain or email is added to the list.
Troubleshooting
Plugin Not Working?
Issue: Domains or emails are not being blocked
- Solution: Ensure Forminator plugin is installed and activated
- Solution: Verify the target field name is exactly
email-1 - Solution: Clear browser cache and test again
Issue: Error message not showing
- Solution: Check that the domain or email is correctly formatted in its list
- Solution: Ensure no duplicate spaces or special characters
Issue: Valid domains being rejected
- Solution: Check domain format - must contain at least one dot (e.g.,
example.com) - Solution: Verify domain doesn't have accidental spaces or special characters
Issue: Valid emails being rejected or not saved
- Solution: Check that the email is a complete, correctly formatted address (e.g.,
name@example.com) - Solution: Invalid entries are silently dropped during save — re-check the list after saving
Issue: Unable to add domains or emails
- Solution: Verify you have admin capabilities
- Solution: Check WordPress file permissions on
/wp-content/folder
Security Considerations
- Data Storage: Blocked domains and blocked emails are stored as two separate entries in WordPress options (serialized)
- Validation: All domains and emails are validated before storage
- Sanitization: Input is sanitized and normalized (lowercase, trimmed, deduplicated)
- Permission Control: Only users with
manage_optionscapability can edit settings - Data Cleanup: Plugin cleanly removes all data (both lists) on uninstall
API Reference
Hooks & Filters
Filter: forminator_custom_form_submit_errors
- Used internally to validate and block domains and emails
- Priority: 10
Filter: forminator_custom_form_invalid_form_message
- Customizes global error message for blocked domains/emails, using the stored transient to indicate whether an email or a domain rule matched
Option Keys:
forminator_blocked_domains– Stores the list of blocked domains in WordPress optionsforminator_blocked_emails– Stores the list of blocked email addresses in WordPress options
Changelog
Version 1.2.0
- New: Email Address Blocking – Added a second list where admins can block specific full email addresses, independent of the domain list
- Priority Matching – Exact email matches are checked before domain matches, so a specific-address rule always applies correctly
- Distinct Error Messages – Error messages now clearly state whether a specific email address or an entire domain was blocked
- Expanded Uninstall Cleanup – Uninstall routine now also removes the new
forminator_blocked_emailsoption - Settings Page Update – Admin settings page now shows two sections: "Blocked domains" and "Blocked email addresses"
Version 1.1.2
- Enhanced Error Messages – Error messages now dynamically display the blocked domain name (e.g., "Invalid Email address, emails from the domain 'live.com' are not allowed.")
- Improved Global Message – Global form error message now retrieves and displays the specific blocked domain using transients
- Better User Feedback – Users now see exactly which domain is blocked, making it clearer what went wrong
Version 1.1.1
- Enhanced domain validation with improved regex patterns
- Added deduplication of domain entries
- Improved sanitization for accidentally pasted URLs
- Better error handling for edge cases
- Increased plugin stability
Version 1.0.0
- Initial release
- Basic domain blocking functionality
- Admin settings interface
- Forminator form validation
Support & Maintenance
- Developer: Noushad Nipun
- Website: noushadnipun.com
- GitHub: github.com/noushadnipun
- Email: hello@noushadnipun.com
Contributing
Contributions are welcome! If you'd like to improve this plugin:
- Fork the repository on GitHub
- Create a feature branch for your changes
- Submit a pull request with detailed description
- Ensure code follows WordPress coding standards
Reporting Issues
Found a bug or have a feature request? Please:
- Check the GitHub Issues page
- Provide detailed information about the issue
- Include WordPress version, PHP version, and Forminator version
- Contact hello@noushadnipun.com for support
Development Notes
- Code Structure: Object-oriented with
FEDB_Pluginclass - Hooks Used:
admin_menu,admin_init,plugins_loaded,forminator_custom_form_submit_errors,forminator_custom_form_invalid_form_message - Text Domain:
forminator-email-domain-blocker - License: GPL-2.0-or-later
License
This plugin is licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).
You are free to use, modify, and distribute this plugin in accordance with the terms of the GPL-2.0-or-later license.
Acknowledgements
Special thanks to the WordPress and Forminator communities for their support and inspiration in developing this plugin.