Login Protection & Two-Factor Authentication

Stop brute-force attacks with login limits and lockouts, hide the login URL, enforce strong passwords, add two-factor authentication and passwordless email login.

Free Elephanta → Security → Login / Two-Factor 2 min read Updated
On this page

These settings live in the Login, Two-Factor and Users tabs of Elephanta → Security.

#Limit login attempts

Brute-force protection and a hidden login address.
  • Allowed failed attempts within a time window, then a temporary lockout.
  • A long lockout after repeated lockouts in 24 hours, and a permanent block after many lockouts in 30 days.
  • Trusted IPs that are never locked out.
  • Hide whether the username or the password was wrong so attackers learn nothing.
  • Cookie-based brute-force prevention.

#Hide the login URL

Switch on Hide the WordPress login URL and choose a new login address. Visitors to /wp-login.php and /wp-admin no longer see the login form. If the address is too easy to guess, Elephanta uses secure-login instead.

Bookmark your new login address

Save the new address somewhere safe. If you forget it, add define( 'ELEPHANTA_SECURITY_DISABLE', true ); to wp-config.php, log in at /wp-login.php, check the address, then remove the line.

#Accounts and sessions

  • Prevent user enumeration (stops ?author=1 lookups).
  • Log out inactive users after a number of minutes.
  • Manually approve new user registrations: new accounts can't log in until approved under Users.
  • Allow only one active session per user: logging in ends sessions on other devices.
  • Enforce strong passwords (upper and lower case, a number and a symbol) with a minimum length, for the roles you choose.

#Two-factor authentication (2FA)

  1. Open Security → Two-Factor and switch on Enable two-factor authentication.
  2. Choose the allowed methods: an authenticator app (Google Authenticator, Microsoft Authenticator, Authy, 1Password…) and/or a one-time code by email.
  3. Require 2FA for these roles (for example Administrator and Editor). Users in these roles set up 2FA at their next login.
  4. Optionally give new accounts a grace period: only require it once the account is this many days old.
  5. Set a trusted device period (days) so users aren't asked on every login.

#Passwordless login with an email code

Allow users to log in with a one-time code sent by email instead of a password, and choose how many minutes the code stays valid.

#Login screen appearance

Customize the 2FA, email-code and success screens with a page title, logo URL and accent colour.

Application passwords

Application passwords skip two-factor authentication. If you don't use them, disable them under File Security → WordPress hardening.