sandywp / plugins / block-wp-login
Block wp-login
Blocks direct access to wp-login.php and replaces it with a secret login URL to reduce brute-force traffic on Apache servers.
Ready in seconds.
v1.5.9 600+ installs WP 5.0+ PHP 7.0+

About this plugin
Block wp-login.php and use a secret login URL
Block wp-login prevents automated requests from reaching the default WordPress login endpoint. It creates a secret login URL for authorised users and adds Apache rewrite rules that return a 403 Forbidden response for direct requests to wp-login.php.
Because blocked requests are rejected before WordPress loads, the plugin can reduce the server resources consumed by bots repeatedly targeting wp-login.php.
Features include:
- Choose your own secret login slug or generate a random one.
- Block direct access to the default wp-login.php endpoint with a 403 response.
- Continue to support password resets, registration and WordPress administration email verification through the secret login URL.
- Rebuild the secret login file after a WordPress core update.
- Optionally email administrators when the login URL changes.
- Optionally notify the site owner when an administrator signs in from an IP address that is not on the known-IP list.
Important compatibility information
Block wp-login requires an Apache web server with mod_rewrite and a writable .htaccess file in the WordPress root directory. It is not compatible with Nginx or servers that do not honour .htaccess rules.
Hiding the default login endpoint reduces automated login traffic, but it is not a replacement for strong passwords, two-factor authentication, updates, backups or other appropriate security controls.
Questions
- What is wp-login.php?
wp-login.php is the standard WordPress endpoint for login, registration and password-reset requests. Its predictable location is frequently targeted by automated bots.
- Does this plugin stop every brute-force attack?
No. It blocks automated traffic aimed at the default wp-login.php address and can reduce the associated server load. If someone discovers the secret login URL, normal WordPress authentication still applies. Use strong unique passwords and other suitable security controls as well.
- Does it work with Nginx?
No. Block wp-login relies on Apache mod_rewrite and .htaccess. Do not activate it on Nginx or another server that does not process Apache .htaccess rules.
- Can users reset their passwords or register?
Yes. Password-reset emails, reset forms and registration links use the secret login URL. WordPress administration email verification is also supported.
- What happens after a WordPress core update?
The plugin detects a changed WordPress version and rebuilds its secret copy of the current wp-login.php file. If the server is overloaded, it safely defers that work until a later administrator request.
- What should I do if I forget the secret login URL?
First check the notification email sent when the URL was configured. If you have command-line access, deactivating the plugin with WP-CLI runs its cleanup routine and restores the default login endpoint. Otherwise, ask your hosting provider or developer to remove the section between
# BEGIN BlockWPLoginand# END BlockWPLoginfrom the WordPress .htaccess file before deactivating the plugin. Take a backup before editing .htaccess.- How do I return to the standard WordPress login URL?
Go to Settings > Block wp-login, clear the Private login address field and save the settings, or deactivate the plugin normally. The plugin removes its rewrite rules and generated login file.
sandywp / also on the shelf
Try another plugin
Limit Login Attempts Security – Login Security, 2FA, Firewall, Brute Force…
4.8 · 1M+ installs
WordPress login security with brute force protection, Two-factor authentication (2FA/MFA), firewall, IP/country blocking, and…
5.0 · 200K+ installs
CloudSecure WP Securityは、管理画面とログインURLをサイバー攻撃から守る、国産・日本語対応のセキュリティ対策プラグインです。 簡単な設定だけで、不正アクセスや不正ログインからWordPressを保護し、サイトのセキュリティを高めます。
Anti-Malware Security and Brute-Force Firewall
4.9 · 100K+ installs
This Anti-Malware scanner searches for Malware, Viruses, and other security threats and vulnerabilities on your server and it…
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.