Hostinger has a built-in tool that sits above your WordPress plugins, meaning you can block countries without breaking your site speed or worrying about cache conflicts.
Here is the step-by-step fix for Hostinger users:
Option 1: The “Hostinger CDN” Method (Easiest)
If you are on a “Business” or “Cloud” hosting plan, Hostinger gives you a built-in CDN that handles this for you.
- Log in to your Hostinger hPanel.
- Go to Websites and click Manage next to your site.
- In the sidebar, search for CDN (or look under the “Performance” section).
- If it is not active, click Enable.
- Once enabled, look for the “Traffic Blocking” or “Block Visitors” section.
- Select Block by Country.
- Add the countries you want to ban.
Why this works: Hostinger checks the visitor’s location before they even touch your WordPress installation. The blocked user never gets to your cache, so the “snapshot” problem never happens.
Option 2: The Cloudflare Integration (Free & Best)
If you don’t see the Hostinger CDN option (or are on a different plan), Hostinger has a one-click integration for Cloudflare, which is the industry standard for this.
- In your hPanel, go to Websites > Manage.
- Search for Cloudflare in the sidebar.
- Follow the prompts to connect your domain (it is usually a few clicks).
- Once connected, log in to your account at Cloudflare.com.
- Go to Security > WAF (Web Application Firewall).
- Create a rule:
If Country equals [X], then Block.
Option 3: The .htaccess Method (Manual Fallback)
If you absolutely cannot use the options above, you can block countries at the server level using a file called .htaccess. This works even with page caching enabled because the server checks this file before loading the cache.
- Go to hPanel > Files > File Manager.
- Open the
public_htmlfolder. - Find the file named
.htaccess(right-click to edit). - You will need to paste a list of “Deny” rules for the specific country IPs.
- Note: I do not recommend this unless necessary, as you have to manually update the list of IPs every month, otherwise the block stops working.
My Recommendation: Check Option 1 first. If you see “CDN” in your Hostinger dashboard, that is a 2-minute fix that solves your problem permanently.