Create a server

How to allow access from abroad

As part of our protection against attacks on WordPress, we block access to wp-login.php. Access is allowed only from the Czech Republic and Slovakia, which we enforce with the Apache module mod_geoip (documentation).

If you try to connect from anywhere else, you’ll see this warning:

“Zakazan pristup mimo SK a CZ. skrze .htaccess povolte svou IP” (Access denied outside SK and CZ. Allow your IP via .htaccess.)

How do you allow access from abroad?

Add the following code to your .htaccess file:
(choose one of the color-coded options: allow by IP / password-protected access)

[code]
<IfModule mod_geoip.c>
<FilesMatch “wp-login.php”>
SetEnvIf GEOIP_COUNTRY_CODE SK AllowCountry
SetEnvIf GEOIP_COUNTRY_CODE CZ AllowCountry
Require all denied
Require env AllowCountry
# for IP address 1.2.3.4
Require ip 1.2.3.4
</FilesMatch>
</IfModule>[/code]

Blocking with username and password authentication
[code]
AuthType Basic
AuthName “WP login“
# absolute path to the .htpasswd file with users and passwords
AuthUserFile /DISKx/www/customerid/domain.tld/subdomain/.htpasswd
Require valid-user[/code]

To allow access from anywhere in the world (not recommended):

[code]
<IfModule mod_geoip.c>
<FilesMatch “wp-login.php”>
Require all granted
</FilesMatch>
</IfModule>[/code]

Why do we block access?

  • Most attacks on wp-login.php come from abroad. A targeted attack can completely “knock out” a site or slow it down significantly.
  • If an attacker cracks the password and gets into the WordPress admin, the site gets infected with malicious scripts.
  • Malicious scripts can damage the site irreversibly and stop it from working altogether.
  • By the time anyone notices the site has been compromised, a lot of time has passed, and the only way to fix it is to restore it from backups.

Security comes first!

Sometimes there’s really no way around it and you need unblocked access to your site. It can be as simple as traveling or working with partners or users abroad. In that case, use the code above to turn off the blocking.

If you turn off the blocking, use a security plugin (e.g., iThemes Security). Installing the plugin and setting up its security features will take a little while, but trust us, it’ll save you plenty of time down the road and spare you a lot of trouble.

You might also like

We support PHP 8.6

We support PHP 8.6

We’re happy to announce that we’re preparing support for the upcoming PHP 8.6 release. What does it mean for your sites in practice, and why should you care about this version? Faster response and lower server load Every PHP generation…

Read more
Critical PHP vulnerability: check the PHP version on your managed server

Critical PHP vulnerability: check the PHP version on your managed server

Today, October 21, 2026, the PHP team is releasing an emergency security update. It fixes two critical flaws in the PHP core that could allow an attacker to run their own code on the server. As soon as it’s out,…

Read more
Migrating your website to WPCloud with a plugin

Migrating your website to WPCloud with a plugin

The WPCloud Migrator plugin moves a WordPress website from any hosting provider to a WPCloud server. It transfers your files, database, plugins, themes, media library, and configuration. You don’t need FTP or SSH access, and even large websites are no problem —…

Read more