Configuring the Firewall and Extended Protection
Start your Wordfence setup on the Wordfence > Firewall page: turn on Extended Protection with “Optimize the Wordfence Firewall”, and after a one-week learning mode, switch the firewall to “Enabled and Protecting”. Then set the Brute Force Protection and Rate Limiting values under “All Firewall Options”, and configure 2FA on the Wordfence > Login Security page; loading the firewall before the WordPress core improves both protection and performance.
- Enable Extended Protection: Click the “Optimize the Wordfence Firewall” button on the Wordfence dashboard to have the
.htaccessor.user.inifile configured automatically; this makes the firewall run before your site every time PHP executes. - Manage Learning Mode Correctly: When you first install the plugin or add a new WooCommerce plugin, keep the firewall in “Learning Mode” for one week so that legitimate customer actions and payment callbacks (IPN) aren’t blocked.
- Whitelisted URL Definitions: If you have external accounting or shipping integrations that use the WooCommerce REST API, make sure these connections are added to the “Whitelisted URLs” section under “Firewall Options”.
- IP Blocklist Updates: Keep the “Wordfence Security Network” option enabled so that IP addresses attacking other Wordfence sites are blocked before they reach yours; the real-time IP blocklist, however, is only available in the Premium version.
Real-Time IP Blocking Strategies
Instead of blocking attackers manually, switching on a rule-based automatic blocking system saves time.
- Country Blocking (Premium): If you only sell within your own country, use the “Country Blocking” feature to block traffic from high-risk countries (China, Russia, etc.) on the login page or across the entire site.
- Adding Manual IP Blocks: Identify IP ranges that keep creating spam orders or registrations and block them permanently from the “Blocking” menu.
- Advanced Signature Scanning: Don’t switch the rules to “High Sensitivity” mode in order to check known attack signatures (SQL injection, XSS) more strictly on checkout pages; this can increase the false-positive (wrongful blocking) rate, and the default rules are usually sufficient.
| Setting Category | Default Value | Recommended WooCommerce Setting | Security Impact | Risk level |
|---|---|---|---|---|
| Firewall Mode | Learning Mode | Enabled and Protecting | Active attack blocking | Critical |
| Failed Login Limit | 20 attempts | 3 attempts | Brute force protection | High |
| Forgot Password | 20 attempts | 5 attempts | Prevents user enumeration | Medium |
| XML-RPC | On | Fully disabled | Blocks DDoS and brute force | High |
| File Changes | Automatic scheduled scan | Standard scan (High Sensitivity if suspicious) | Backdoor detection | Critical |
Brute Force Protection Tailored to WooCommerce
Brute force attacks wear down the system by trying to guess the passwords of admin or customer accounts and can lead to data leaks. Because customer accounts are also a target on WooCommerce sites, you should apply stricter rules than the default WordPress settings.
- Lower Login Attempt Limits: Limit the “Lock out after how many login failures” setting to a maximum of 3; high numbers such as 20 attempts give bots a wide window.
- Block Failed Forgot Password Requests: Stop bots trying to enumerate your user database by lowering the “Lock out after how many forgot password attempts” setting to a low value such as 5; 1–2 can lock out real customers who have forgotten their password.
- Prevent Username Leaks: Be sure to check the “Prevent discovery of usernames through ‘/?author=N’ scans” option; this makes it harder for attackers to find admin usernames.
- Lock Out Invalid Usernames Immediately: Enable the “Immediately lock out invalid usernames” feature and add usernames such as “admin”, “administrator” and “shop_manager” to the banned list.
Rate Limiting and Bot Blocking
E-commerce sites are crawled heavily by price scrapers and stock-tracking bots, which consume server resources and slow down access for real customers. Rate Limiting settings are the most effective way to keep non-human traffic under control.
- Restrict Crawl Rate: Set “If anyone’s pages not found (404s) exceed” to 30 per minute; a normal user doesn’t hit 30 missing pages in a minute, and whoever does is usually a security scanner.
- Filter Bot Traffic: Limit the “If a crawler’s pages accessed exceed” option to 240 per minute (4 pages per second); legitimate bots such as Googlebot usually stay within these limits, and those that exceed them are usually aggressive scrapers.
- Block Fake Googlebots: Be sure to check the “Block fake Google crawlers” option to completely cut off server access for bots that claim to be Googlebot but have malicious intent.
- Tolerance for Human Traffic: Don’t set “If a human’s pages accessed exceed” too low (for example, 400–500 per minute may be reasonable); otherwise you may accidentally block potential customers who browse products quickly.
Source: Official Wordfence plugin page
Related serviceWordPress Security Settings ↗Login Security and Two-Factor Authentication (2FA)
Passwords alone are no longer an adequate security measure. Accounts with access to customer data, order details and the payment infrastructure in particular need an extra layer of security.
- Role-Based 2FA Requirement: In the Wordfence 2FA settings, set 2FA to “Required” for the “Administrator” and “Shop Manager” roles.
- Set a Grace Period: Give newly created admin accounts a maximum of 24 hours to set up 2FA, and block their dashboard access after that.
- Disable XML-RPC: If you don’t use Jetpack or the mobile app, enable the “Disable XML-RPC authentication” option; this protocol is a backdoor often used to bypass 2FA.
- Remember Trusted Devices: Set the “Remember Device” period to 30 days so administrators don’t have to enter a code at every login; this balances convenience and security.
Payment Gateways and Allowlist Management
The most common mistake on WooCommerce sites is the firewall blocking the IP addresses of payment gateways. As a result, the order shows as “Pending” or “Failed” in the dashboard even though the payment was taken from the bank.
- Add Payment Provider IPs: Find the webhook IP addresses in the documentation of the payment gateway you use (Stripe, PayPal, etc.) and add them to the Wordfence “Allowlisted IP addresses” section.
- Parameter-Based Permissions: Some parameters carried in the URL on payment returns can look like SQL injection; identify these parameters in the firewall logs and allowlist them to stop false-positive blocks.
- Static IP for Admin Access: If your office or home internet uses a static IP, add that IP address to the allowlist to remove the risk of locking yourself out.
- Cron Job Permissions: Add your server IP (127.0.0.1 or the server’s external IP) to the allowlist to make sure WordPress scheduled tasks (WP-Cron) and server-side cron jobs aren’t interrupted by the firewall.
Malware Scanning and File Integrity
The Wordfence scanner compares changes in your files with the original versions in the WordPress repository. Unauthorized changes to WooCommerce files can be a warning sign of malicious code that steals credit card details (skimmers).
- High Sensitivity Scan: Use “High Sensitivity” mode under “Scan Options” only for manual scans when something looks suspicious; for routine scans, “Standard Scan” is enough and doesn’t strain the server.
- Check Core and Theme Files: Keep the “Scan core files against repository versions”, “Scan theme files against repository versions” and “Scan plugin files against repository versions” options enabled so that changes to the core, themes and plugins are reported in scans.
- File Content Scanning: The “Scan file contents for backdoors, trojans, and suspicious code” option must always be on; it detects malicious code hidden inside files even when the file names look normal.
- Exclude Image Files from Scanning: To protect server performance, you can keep the “Scan images, binary, and other files as if they were executable” option off, but you should block PHP execution in the uploads folder at the server level.
Notification Management and Live Traffic Analysis
Staying informed about security events is important, but unnecessary notifications cause “alert fatigue”, which leads to real threats being overlooked. Notifications need to be filtered wisely.
- Receive Only Critical Alerts: Turn off low-priority notifications such as “Email me when Wordfence is automatically updated” or “Email me if that admin logs in”; keep only “Security Alert” level alerts on.
- Use Summary Reports: Instead of getting an email for every blocked IP, set the “Activity Report” feature to send a weekly or daily summary.
- Limit Live Traffic: The “Live Traffic” feature performs a lot of database writes; switch it to “ALL TRAFFIC” mode only when you’re under attack or debugging, and keep it in “Security Only” mode the rest of the time.
- Admin Login Notifications: Customize the rules so you’re notified only when the “Administrator” role logs in from a new device or a different country.
Source: Wordfence documentation on WordPress.org
Frequently Asked Questions
Is the free version of Wordfence enough for WooCommerce?
For small and mid-sized stores, the free version provides strong protection, but you may need Premium for country blocking and real-time signature updates.
Will Wordfence slow down my site?
If it’s misconfigured and the “Live Traffic” feature is kept on all the time, it can bloat the database; with the recommended settings, the performance impact is minimal.
Can Cloudflare and Wordfence be used together?
Yes. Cloudflare provides protection at the network (proxy) level, while Wordfence protects at the application level; in the Wordfence settings, you should enable the “Use the Cloudflare ‘CF-Connecting-IP’ HTTP header” option.
Why aren’t WooCommerce order notifications coming through?
The firewall may be blocking your payment provider’s IP addresses; check the blocked requests in the “Live Traffic” section and allowlist the relevant IPs.
The Wordfence tables take up a lot of space in the database. What should I do?
You can use the “Delete Wordfence tables and data on deactivation” option in the Wordfence settings, or reduce the table size by shortening how long “Live Traffic” records are kept.
Result
A properly configured Wordfence setup goes a long way toward securing your WooCommerce store. By applying the steps above, you protect your site against sophisticated threats while also keeping the customer experience smooth.
In short
This guide covers the recommended Wordfence configuration settings for WooCommerce sites. It includes extended firewall setup, brute force protection strategies, bot blocking methods and allowlist management for payment gateways. With performance optimization and mandatory 2FA, it also aims to take your store’s security to the highest possible level.
















