How to protect wp-admin and wp-login by country without blocking Google or Cloudfla

What is the name of the domain?

example.com

What is the issue you’re encountering

Hello, I don’t know what I’m doing wrong, I want to allow the countries that appear in the rule that I show you to enter wp-admin and block the rest of the non-Spanish speaking countries (although I normally enter from France, I would have to add it too , and my country is Spain). But the thing is that I block access to the website and it stops being visible on the home page and it also blocks adsense and cloudflare requests, what can I do? I just have no idea how to do it.

What is the current SSL/TLS setting?

Full (strict)

What are the steps to reproduce the issue?

This rule leaves the website blocked on mobile phones (at least the one I use), and I cannot access any url on the website. (http.request.uri.path contains “/wp-admin”) or (http.request.uri.path contains “/administrator” and ip.geoip.country in {“AD”}) or (ip.geoip.country in {“AR”}) or (ip.geoip.country in {“BO”}) or (ip.geoip.country in {“CL”}) or (ip.geoip.country in {“CO”}) or (ip.geoip.country in {“CR”}) or (ip.geoip.country in {“CU”}) or (ip.geoip.country in {“DO”}) or (ip.geoip.country in {“EC”}) or (ip.geoip.country in {“SV”}) or (ip.geoip.country in {“GT”}) or (ip.geoip.country in {“HN”}) or (ip.geoip.country in {“MX”}) or (ip.geoip.country in {“NI”}) or (ip.geoip.country in {“PA”}) or (ip.geoip.country in {“PY”}) or (ip.geoip.country in {“PE”}) or (ip.geoip.country in {“PR”}) or (ip.geoip.country in {“ES”}) or (ip.geoip.country in {“UY”}) or (ip.geoip.country in {“VE”} action: block

Screenshot of the error

Rather, wp-login.php? :thinking:

If the login is the concern, I’d suggest putting wp-login.php behind a Cloudflare Access and use Zero Trust for such case where you include your email address (only) or add additional criteria like country France (user has to be from France - by the network IP address and the email entered has to be your private only to get the PIN code for authentication to proceed to wp-login.php page).
See my post below with more links and resources how to achieve this: