Linux 软件免费装
Banner图

Protect WP Login – Password Protect wp-login.php with Basic Auth

开发者 clickar
alebuo
更新时间 2026年10月14日 23:34
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

security login htaccess brute force basic auth

下载

1.1.1 1.1.2 1.0 1.1

详情介绍:

Protect WP Login adds a second password in front of your WordPress login page. Before the login form is shown, the web server asks for an extra username and password (HTTP Basic Authentication through .htaccess). Bots and brute force attacks are rejected by the server, so they never reach WordPress, PHP or your database. Why protect wp-login.php at the server level? Every request to wp-login.php loads WordPress and queries the database, even when it comes from a bot trying thousands of passwords. Plugins that limit login attempts or add a CAPTCHA still have to do that work for every attempt. With Protect WP Login the server rejects those requests before WordPress starts: Features How it works
  1. A visitor or a bot opens wp-login.php.
  2. The web server asks for the extra username and password managed by the plugin.
  3. Only with the right credentials the usual WordPress login form is shown. Wrong credentials are rejected by the server.
Requirements

安装:

  1. Install the plugin from 'Plugins > Add New Plugin', or upload the plugin files to the /wp-content/plugins/protect-wp-login directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. You will be taken to the 'Protect WP Login' page, where the generated username and password are shown. Save them before logging out, or create your own users on the same page.

屏幕截图:

  • The username and password generated on activation stay visible until you confirm you saved them.
  • A reminder is shown on the dashboard until the generated credentials are saved.
  • The browser asks for the extra username and password before showing wp-login.php.
  • After the extra authentication, the usual WordPress login form appears.
  • Adding a new user. The list shows all the users that can pass the extra authentication.
  • If the hosting doesn't support the rules, they are removed automatically and the panel explains why.

升级注意事项:

1.1.2 Translation improvements. 1.1.1 Adds translations into Spanish, German, French, Italian and Portuguese. 1.1 Fixes password protected posts, safer .htaccess handling with automatic rollback, and credentials that no longer disappear after activation. Your existing users are kept.

常见问题:

How is it different from other login security plugins?

Plugins like Wordfence or Limit Login Attempts check each login attempt inside WordPress, after it has loaded. Protect WP Login blocks the request at the web server, before WordPress loads, so bots don't use your server resources. You can use both: Protect WP Login is an extra layer in front of your security plugin.

I got locked out. How do I get back in?

Connect to your site by FTP or with the file manager of your hosting, open the .htaccess file in the WordPress folder and delete the lines between # BEGIN Protect WP Login and # END Protect WP Login. You can also rename the wp-content/plugins/protect-wp-login folder to deactivate the plugin.

Will it work on my hosting?

It works on Apache and LiteSpeed servers that allow .htaccess files, which covers most shared hosting. After writing the rules the plugin checks your site: if the server answers with an error, the rules are removed automatically and the status panel explains what happened.

Does it work on Nginx?

Nginx doesn't read .htaccess files. The plugin page shows the configuration you (or your hosting provider) have to add to the Nginx server to protect wp-login.php with the same users.

Do password protected posts still work?

Yes. Visitors can still unlock password protected posts and pages without knowing the extra credentials.

Should I also protect xmlrpc.php?

If you don't use Jetpack, the WordPress mobile app or another service that publishes through XML-RPC, enabling it blocks another common entry point for brute force attacks.

Do I need to enter the extra password every time?

Browsers remember Basic Authentication credentials during the session, and most of them (Chrome, Firefox, Edge, Safari) offer to save them like any other password, so you don't have to type them again.

How do I add or delete users?

Go to the 'Protect WP Login' page in the admin menu. Enter a username and password and click 'Save' to add a user, or click 'Delete' next to an existing user. There is always at least one user.

Do I need a complex username and password?

A simple combination is enough to stop bots, because they are blocked before reaching WordPress. The password can't be the same as the username.

Is it secure without HTTPS?

Basic Authentication sends the credentials in every request to wp-login.php, just like the WordPress login form. Use HTTPS (free with Let's Encrypt on most hosting) to keep them private.

更新日志:

1.1.2 1.1.1 1.1 1.0