Learn how to Lock Down Your WordPress Login using Cloudflare firewall rules to block foreign login attempts and protect your site from brute-force attacks.Brute-force login attacks are one of the most common ways WordPress sites get hacked. Even if you hide your login URL or use strong passwords, bots from around the world are constantly trying to access /wp-login.php and /wp-admin.
One of the most effective security steps you can take is to block WordPress login access by country — allowing only Ireland to reach your login page, and blocking the rest of the world automatically.
In this guide, I’ll show you how to do exactly that using Cloudflare Custom Firewall Rules.
Most WordPress attacks come from automated bots based outside Ireland. By blocking login access at Cloudflare level:
If you (and your team) only log in from Ireland, this is one of the strongest protections you can add.
Before you begin:
Security → WAF → Custom Rules
Give the rule a name, for example:
Allow Ireland Only – WordPress Login
Click Edit expression in the rule builder.
Delete anything that’s there and paste this exactly:
(http.request.uri.path contains "/wp-login.php"
or http.request.uri.path contains "/wp-admin")
and not ip.geoip.country in {"IE"}
This rule means:
/wp-login.php or /wp-adminSo:
Bots from the Netherlands, Poland, Germany and other countries will never reach your WordPress login page again.
Under Then take action…
Select:
Block
Click Deploy to activate the rule.
Before you log out of WordPress:
yourwebsite.ie/wp-login.php
If it works, the rule is active and working correctly.
If you ever use mobile data, travel abroad, or connect through a VPN, you can avoid locking yourself out by adding a second rule above this one.
Create a new rule:
Condition:
ip.src in {YOUR.PUBLIC.IP}
Action:
Allow
This ensures you always have access to your WordPress admin area.
This single Cloudflare rule gives you:
When combined with two-factor authentication, disabled XML-RPC, and strong passwords, this provides enterprise-level WordPress login protection.
If you manage multiple WordPress sites, you can also apply this rule at account level in Cloudflare so it protects all your domains automatically.
If you’d like help setting this up safely on your site or across multiple client sites, feel free to get in touch.
Schedule a free consultation today.

Design My Website are a web design company based in Kerry. The majority of our meetings are done via video call but we can travel within Munster.