Securing the WordPress Login: 2FA, Login Limits and a Custom Login URL

7 min read Auf Deutsch lesen

The login page is the most frequently attacked part of a WordPress install – automated bots try usernames and passwords around the clock. The good news: a few measures make this attack route practically useless, without cluttering your site with plugins.

1. Two-Factor Authentication (2FA)

The most effective single measure. Even if a password is cracked or leaked, the attacker is missing the second factor – a time-based code from an authenticator app like Google Authenticator or Aegis. 2FA comes as a lean plugin; enable it at least for all administrator accounts, better for anyone who can log in. When setting it up, store the recovery codes somewhere safe so you don’t lock yourself out.

2. Limit Login Attempts

Brute-force attacks rely on being able to try indefinitely. A login limit locks the IP for a while after a few failed attempts – and makes mass guessing pointless. Many security plugins include this. Don’t set the lock too aggressively, so legitimate users don’t get permanently locked out after a typo.

3. Strong, Unique Passwords

Sounds obvious, but it’s the foundation. Every admin account gets a long, unique password from a password manager. And: delete the default username “admin” – it’s half the battle for any attacker, because then they only have to guess the password. Instead, create a new admin with its own name, transfer the content and remove “admin”.

4. Keep an Eye on xmlrpc.php

An often-overlooked side entrance: the xmlrpc.php file lets attackers try hundreds of passwords in a single request – brute force at high speed. If you don’t use services that need XML-RPC (some app integrations, for example), access to it can be blocked. Many security plugins offer a switch for this.

5. Obscure the Login URL (Optional)

Moving the login page from /wp-login.php to a custom address keeps most automated bots away. It’s not real security (security by obscurity), but it noticeably reduces load from bot requests. Useful as an addition, not a replacement for 2FA and a login limit.

6. Keys and Constants

Reset the security keys in wp-config.php (this invalidates stolen sessions) and disable the in-dashboard file editor, so a compromised account can’t directly execute code. The wp-config hardening generator produces both at the press of a button.

What Really Counts – in Order

  1. 2FA for all admins.
  2. Login limit against brute force.
  3. Strong passwords, no “admin” user.
  4. Block xmlrpc.php if not needed.
  5. New keys and file editor off.
  6. Move the login URL (optional extra).

You don’t need more than one security plugin for this – in fact, several at once often interfere with each other. And the best login protection doesn’t replace ongoing upkeep: updates, backups and monitoring belong to it, as described in the security overview.


Want to secure the login cleanly without stacking five plugins? Drop us a line – we’ll harden login and backend in a targeted way.

Frequently Asked Questions

How do I secure the WordPress login?

In this order: two-factor authentication for all administrators, a login limit against brute-force attacks, strong and unique passwords without the default admin user, freshly set security keys in wp-config.php, and a disabled file editor. Moving the login URL is the optional extra. Together these measures make the most common attack route practically useless.

What is the most effective measure against brute-force attacks?

Two-factor authentication. Even if a password is cracked or known from someone else's leak, the attacker is missing the second factor from the authenticator app. Combined with a login limit that locks the IP after a few failed attempts, mass guessing becomes pointless – the two together are the core of a secure login.

Does changing the login URL actually add security?

Only to a limited degree. Moving the login page from /wp-login.php to a custom address keeps many automated bots away and reduces server load from attack requests. But it's security by obscurity, not real security: anyone who knows the new address is in the same position as before. So it's a sensible addition, but no replacement for 2FA and a login limit.

Do I need a security plugin for WordPress?

A single, established security plugin that includes 2FA and a login limit is usually enough. Several security plugins at once are actually counterproductive: they overlap in function, interfere with each other and make problems harder to trace. Fewer, but correctly configured, is clearly better than many here.

Daniel Nilges
Daniel Nilges

Founder & Full-Stack Developer

20+ years of web development experience. Specialised in Laravel, WordPress and custom software for mid-sized businesses.