保护WordPress登录的另一个好方法是限制对特定IP地址的访问。如果您或只有几个受信任的用户需要访问管理区域,此提示特别有用。
只需将此代码添加到.htaccess文件。
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist Syed's IP address
allow from xx.xx.xx.xxx
# whitelist David's IP address
allow from xx.xx.xx.xxx
</LIMIT>
不要忘记用自己的IP地址替换xx值。如果您使用多个IP地址访问互联网,请确保添加它们。