Skip to content
BeoHosting
BeoHosting
Security

How to Protect the WordPress Admin Panel

BeoHosting Team··9 min read read
How to Protect the WordPress Admin Panel

Why protecting the admin panel is critical

The WordPress admin panel is the most common target of hackers because admin panel access gives them full control of the site. Every WordPress site has a default login page at /wp-admin or /wp-login.php, which is general knowledge. Automated bots try to access these URLs 24 hours a day using brute force attacks, password dictionaries, and stolen credentials from data breaches. According to statistics, the average WordPress site receives over 10,000 unauthorized login attempts per month.

A compromised admin panel lets an attacker install malware, steal user data, use the server to send spam emails, place phishing pages, or completely delete the site. The consequences can be catastrophic including lost revenue, damaged reputation, legal problems from data leaks, and blacklisting by Google. Admin panel protection isn't optional but a mandatory security measure for every WordPress site.

Changing the login URL

Why change the URL

Changing the default login URL is the first line of defense known as security through obscurity. Although this alone isn't enough for protection, it significantly reduces the number of automated attacks because bots look for /wp-admin and /wp-login.php addresses. A changed URL eliminates the vast majority of automated brute force attacks, which make up 95 percent of all attacks on WordPress login pages.

WPS Hide Login plugin

WPS Hide Login is a lightweight plugin with over a million active installations that simply changes the login page URL. After installation, go to Settings, then WPS Hide Login, and enter a new URL like /my-access or /secret-entry. The plugin doesn't change files and doesn't add rewrite rules - it simply intercepts requests. Remember the new URL or save it in a safe place because without it you'll be locked out of the admin panel. If you forget the URL, you can deactivate the plugin via FTP or phpMyAdmin by deleting it from the wp-content/plugins directory.

Alternative methods

If you don't want to use a plugin, you can hide the login page using htaccess rules in Apache or a location block in Nginx. For example, you can block access to wp-login.php for everyone except specific IP addresses or use HTTP Basic Authentication as an additional protective layer in front of the WordPress login form. This adds a dialog for username and password before the WordPress login form is even displayed, giving the attacker a double barrier.

Login attempt limiting

Brute force protection

A brute force attack tries different combinations of usernames and passwords until it guesses correctly. WordPress by default doesn't limit the number of login attempts, meaning an attacker can try millions of combinations. Limiting login attempts is an absolutely essential measure that blocks an IP address after a certain number of failed attempts. This makes brute force attacks impractical because the attacker can only try a few passwords before being blocked.

Limit Login Attempts Reloaded

Limit Login Attempts Reloaded is the most popular plugin for this purpose with over 2 million active installations. The plugin blocks an IP address after a set number of failed attempts with progressively longer block times. The recommended configuration is 3 allowed attempts before a 20-minute block, then 3 blocks before an extended 24-hour block. The plugin sends email notifications to the administrator about blocked IP addresses and provides statistics on the number of blocked attacks.

Fail2ban at server level

For more serious protection, Fail2ban at the server level is a superior solution because it blocks IP addresses at the firewall level before the request even reaches WordPress. Fail2ban reads WordPress auth logs and automatically adds firewall rules for IP addresses with too many failed login attempts. This is more efficient than plugin solutions because fewer server resources are spent on rejecting attacks. Configuration involves creating a Fail2ban jail for WordPress and a filter that recognizes failed login attempts in the access log.

Two-factor authentication (2FA)

What 2FA is and why it's essential

Two-factor authentication adds a second layer of protection alongside the password by requiring something the user knows (password) and something the user has (phone with authenticator). Even if an attacker learns your password via phishing, a data breach, or brute force, they can't access the admin panel without the second factor. Google research shows 2FA blocks 99.9 percent of automated attacks and 96 percent of targeted phishing attacks.

2FA implementation

WP 2FA is an excellent free plugin that supports TOTP time-based one-time passwords that work with Google Authenticator, Authy, Microsoft Authenticator, and other authenticator apps. After installation, each user scans a QR code with the authenticator app and enters a six-digit code that changes every 30 seconds on every login. The plugin also supports backup codes for situations when the user doesn't have access to their phone and the ability to enforce 2FA for specific user roles.

Hardware security keys

For the highest level of security, the WebAuthn standard enables using physical security keys like YubiKey for WordPress login. Hardware keys are phishing-resistant because they're tied to a specific domain and can't be intercepted. WordPress 5.6 and newer have built-in support for Application Passwords, and plugins like WP-WebAuthn add full support for FIDO2 hardware keys. This is recommended for administrators of sites with sensitive data.

IP Whitelist

Restricting access by IP address

If you access the admin panel from a fixed IP address or a small number of known IP addresses, you can restrict access only to those addresses. This is the strictest form of protection because it completely blocks admin panel access from all unknown locations. In the htaccess file in the wp-admin directory, use the Order Deny Allow directive to allow only specific IP addresses. In Nginx use allow and deny directives in the location block for wp-admin.

Dynamic IP problems

Most users have a dynamic IP address that changes periodically, making a static IP whitelist impractical. Solutions include using a VPN service with a fixed IP address that provides a consistent IP regardless of location. Alternatively, you can use CloudFlare Access or Zero Trust solutions that authenticate the user before allowing access to the admin URL. Some plugins like iThemes Security offer the option to send a magic link to email to temporarily add an IP address to the whitelist.

Security plugins

Wordfence Security

Wordfence is the best-known WordPress security plugin with over 4 million active installations. It offers a web application firewall that blocks known attacks before they reach WordPress, a malware scanner that reviews all WordPress files and compares them with originals from the repository, real-time threat intelligence with information about the latest threats, login security with 2FA and brute force protection, and live traffic monitoring that shows all requests in real time. The free version covers most needs while the premium version adds real-time firewall rules and priority support.

Sucuri Security

Sucuri offers a cloud-based WAF which is a DNS-level firewall meaning malicious requests never reach your server. This is particularly effective against DDoS attacks and zero-day exploits because the Sucuri team constantly updates rules. The WordPress plugin offers file integrity monitoring, security logging, blacklist monitoring, and post-hack actions for cleaning a compromised site. Sucuri is a premium service but an excellent investment for business sites and e-commerce platforms.

iThemes Security

iThemes Security, formerly known as Better WP Security, offers over 30 security measures in one plugin. Key features include admin URL change, brute force protection, file change detection, enforcing strong passwords, banning problematic user agents, hiding WordPress version, and automatic updates. The dashboard displays the site's security score with recommendations for improvement. The Pro version adds 2FA, scheduled malware scanning, and reCAPTCHA integration.

Additional protective measures

Strong password and username

Never use admin as a username because that's the first thing bots try. Use a unique username that isn't publicly visible on the site. The password should be at least 16 characters with a mix of upper and lowercase letters, numbers, and special characters. Use a password manager like Bitwarden or 1Password to generate and store strong passwords. Don't use the same password for WordPress admin and other services because a data breach at one service compromises all accounts with the same password.

SSL certificate

An SSL certificate encrypts communication between the browser and server including username and password at login. Without SSL, login data travels in plain text and can be intercepted on public WiFi networks or compromised networks. At BeoHosting all plans include a free Let's Encrypt SSL certificate with automatic renewal. After SSL installation, add the FORCE_SSL_ADMIN constant with value true to wp-config.php to force HTTPS for the entire admin panel.

Regular updates

Most successful attacks on WordPress exploit known vulnerabilities in outdated versions. See the detailed site protection guide, themes, or plugins. Update WordPress, themes, and plugins as soon as a new version becomes available. Enable automatic updates for minor WordPress versions and security patches. Before major updates, make a complete site backup. Delete unused themes and plugins because even deactivated plugins can contain vulnerabilities attackers can exploit.

Conclusion

Protecting the WordPress admin panel requires a multi-layered approach because no single measure is sufficient by itself. Combine changing the login URL to eliminate automated attacks, limiting login attempts for brute force protection, 2FA for protection from compromised passwords, IP whitelist for the strictest access, and a security plugin for comprehensive monitoring and protection. On BeoHosting WP hosting plans server-level protection is included with Fail2ban, ModSecurity WAF, and automatic backup for maximum site security.

BeoHosting Team

10+ years of experience — Web hosting and infrastructure specialists

  • Web Hosting
  • WordPress Hosting
  • VPS
  • Dedicated Serveri
  • Domeni
  • SSL
  • cPanel
  • LiteSpeed
  • Linux administracija
  • DNS

Last updated: