Easily improve site security with WordPress Hardening, Two-Factor Authentication (2FA), Login Protection, Vuln...
Stop bots from brute force hacking your wp-login.php
A Little More Secure is a WordPress plugin designed to enhance the security of the wp-login.php page by preventing brute force attacks from bots. It does this by requiring an unlock parameter for access, which is validated through a nonce. The plugin automatically activates without the need for configuration, making it straightforward to use.
The plugin is suitable for users who want an additional layer of security on their login page without complex setup. It includes features for customisation through filters, allowing developers to modify how the unlock mechanism works if needed.
Best for: This plugin is best for WordPress site owners looking for simple login security enhancements.
What it does well
Where it falls short
A Little More Secure provides a basic yet effective method to protect the WordPress login page. It is easy to implement but may not fully eliminate all security risks.
EdwardBock's own description of A litte more secure, lightly tidied.
Stop bots from brute force hacking your wp-login.php
A request to wp-login.php without an unlock parameter answers with a 404 and a
holding page. JavaScript counts down a few seconds, then redirects to the same
URL with the parameter appended. Only that request renders a usable login form,
and only it carries the nonce that a login POST has to contain — a POST without
a valid nonce is rejected.
This raises the cost of naive automation. It is not a lockout mechanism: whoever
requests the unlock URL first can read the nonce and post with it, which is why
the plugin is called a little more secure.
There is nothing to configure. Activating the plugin is enough.
Three filters, for a theme or a small plugin of your own.
a_little_more_secure_is_unlocked decides whether a request counts as unlocked.
By default that is the presence of the parameter; override it to implement your
own rule, for example a one-time token or an office IP allowlist:
add_filter( 'a_little_more_secure_is_unlocked', function ( $is_unlocked ) {
return $is_unlocked || my_own_check();
} );
a_little_more_secure_get_param_name changes the name of the unlock parameter,
a-little-more-secure by default.
a_little_more_secure_redirect_wait_seconds changes the delay before the
redirect, 3 seconds by default.
A theme with its own login form that posts to wp-login.php has to render the
nonce itself, otherwise the POST is rejected — call
a_little_more_secure_nonce_field() inside the form. Forms built with
wp_login_form() get it automatically.
The default parameter name is public knowledge, so a bot written for this plugin
can hardcode it. If you want a name that changes over time, put the token in the
name itself: the parameter name filter runs both when the redirect URL is built
and when the request is checked, so both sides agree without storing anything.
function my_alms_token( int $bucketsAgo = 0 ): string {
$ttl = 15 * MINUTE_IN_SECONDS;
$bucket = (int) floor( time() / $ttl ) - $bucketsAgo;
return 'alms_' . substr( hash_hmac( 'sha256', 'alms|' . $bucket, wp_salt( 'nonce' ) ), 0, 20 );
}
add_filter( 'a_little_more_secure_get_param_name', function () {
return my_alms_token();
} );
add_filter( 'a_little_more_secure_is_unlocked', function ( $is_unlocked ) {
return $is_unlocked || isset( $_GET[ my_alms_token( 1 ) ] );
} );
Accepting the previous bucket as well keeps a request that crosses a bucket
boundary from being rejected, so the effective validity is 15 to 30 minutes.
Keep the token alphanumeric — PHP rewrites dots and spaces in parameter names.
Be aware of what this does and does not do. It stops bots that hardcode the
parameter name. It does not stop anything that fetches the page and reads the
name out of it — the value has to be handed to the browser before anyone is
logged in, so a scraper can always obtain it too.
Other plugins for securing a site.
Easily improve site security with WordPress Hardening, Two-Factor Authentication (2FA), Login Protection, Vuln...
Firewall, Malware Scanner, Two Factor Auth, and Comprehensive Security Features, powered by our 24-hour team....
The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam sol...
Loginizer is a WordPress security plugin which helps you fight against bruteforce attacks.
Enable SVG uploads and sanitize them to stop XML/SVG vulnerabilities in your WordPress website.
Protect your website investment with All-In-One Security (AIOS) – a comprehensive and easy to use security plu...