移除WordPress登入頁面的錯誤訊息

WordPress 登入畫面在用戶輸入錯誤密碼、或是不存在的帳號時會出現提示。雖然這個作法相當貼心,但卻間接提供有心人士更多資訊,建議你可以將錯誤提示關閉以提昇安全性。


停止協助駭客來入侵你的網誌,只需要打開 functions.php ,然後加入以下函式:

add_filter('login_errors',create_function('$a', "return null;"));

當輸入錯誤密碼、或是帳號不存在時,就不會顯示錯誤訊息。

不過如果你的網誌擁有超過一位以上的作者時,較不建議使用此方法。

This entry was posted in WordPress技巧. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>