Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressのログインエラーメッセージでログインヒントを無効化する方法

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressのログインエラーメッセージのログインヒントを無効化したいですか?

WordPressのログインページでは、ログインに失敗すると初期設定でエラーメッセージが表示されます。これらのメッセージは、意図せずハッカーがあなたのログイン情報を推測する手助けをしてしまう可能性があります。

この投稿では、WordPressのログインエラーメッセージのログインヒントを無効化し、サイトを安全に保つ方法をご紹介します。

How to disable login hints in WordPress login error messages

WordPressのログインエラーメッセージにおけるログインヒントとは?

誰かが間違ったユーザー名やパスワードを使ってサイトにログインしようとするたびに、WordPressはログイン画面にエラーメッセージを表示します。

この人が間違ったユーザー名やメールアドレスを入力した場合、WordPressは次のエラーを表示します:’ユーザー名はこのサイトに登録されていません。ユーザー名が不明な場合は、代わりにメールアドレスを試してください’。

The login hint in WordPress login error messages

これは本物のユーザーには便利かもしれないが、ハッカーには間違ったユーザー名を入力していることを知らせることにもなる。

正しいユーザー名を入力しても、パスワードが間違っているとエラーになります。パスワードをお忘れですか?これにより、潜在的な攻撃者に正しいユーザー名を推測させることができます。

A password hint in the WordPress login error message

誰かがあなたのユーザー名を推測しようとしている場合、このエラーメッセージは、彼らがそれを推測することに成功したことを確認します。あとはパスワードを推測するか盗むだけです。

WordPressサイトの所有者は、ユーザー名の代わりにメールアドレスを使用してサイトにログインすることもできます。これは、ハッカーがWordPressアカウントに使用しているアドレスを把握するために、異なるメールアドレスを入力する可能性があることを意味します。

ハッカーが正しいメールアドレスを推測するとすぐに、WordPressは「ユーザー名に入力したパスワードが間違っています」というエラーに切り替わる。

WordPressブログやサイトをハッカーから守るために、アカウントには常にユニークなユーザー名と強力なパスワードを使用する必要があります。

サイトに他のWordPressユーザーや投稿者を追加した場合は、WordPressプラグインを使用してユーザーに強力なパスワードを作成させることもできます。

これらの手順は素晴らしいスタートですが、ログインヒントはまだハッカーがあなたのサイトに侵入するのを助ける可能性があります。このことを念頭に置いて、WordPressのログインエラーメッセージのログインヒントを非表示にする方法を見てみましょう。

簡単にできるように、WordPressのログインエラーメッセージのログインヒントを無効化する方法のチュートリアル動画を作成しました。

Subscribe to WPBeginner

文書による説明がお好きな場合は、以下のWordPressエラーメッセージからログインヒントを削除する方法のステップバイステップのチュートリアルをご覧ください。

WordPressでログインヒントを非表示にする

WordPressのログインエラーメッセージでログインヒントを無効化する最も簡単な方法は、WordPressにコードを貼り付けることです。通常、初心者の方にはお勧めしませんが、WPCodeを使えば誰でも簡単にWordPressサイトにコードを追加することができます。

以下のコード・スニペットをサイトのfunctions.phpファイルの一番下に追加することもできますが、これはサイトを壊す可能性があります。

無料のWPCodeプラグインのインストールをお勧めします。詳しい手順については、WordPressプラグインのインストール方法をご覧ください。

すべて、WordPress管理ダッシュボードのCode Snippets “+AddSnippetにアクセスするだけです。Add Your Custom Code」にマウスオーバーし、「Use Snippet」をクリックします。

Add new snippet
After that you simply need to name your new snippet and paste the following code into the Code Preview area
function no_wordpress_errors(){
  return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );

このコードは初期設定のログインページエラーを‘Something is wrong!’のようなカスタマイザーメッセージに変更します。

このコードは、WordPressに初期設定のエラーメッセージの代わりにカスタマイザーメッセージを表示するよう指示するもので、上記のコード例ではエラーメッセージとして’Something is wrong!’を使用しています。

この行を変更して、好きなメッセージを表示させることができる。例えば、ここではエラーメッセージとして「Something is wrong!

 return 'Something is wrong!';

コードタイプ」のドロップダウンからPHPを選択し、スイッチを「有効化しない」から「有効化する」に切り替えて、「スニペットを保存」をクリックする。

それができたら、新しいエラーメッセージをテストすることをお勧めします。このテストを行うには、あなたのサイトのログインページに向かい、間違ったユーザー名、パスワード、メールを入力するだけです。そして、「ログイン」ボタンをクリックしてください。

WordPressは新しいエラーメッセージを表示しますが、何が間違っているのかについてのヒントは表示しません。

How to disable the login hints in the WordPress login error

このコードはWordPressのログインヒントを無効化しますが、より高度な試みや総当たり攻撃からあなたを守ることはできません。

ハッカーによるサイトへの侵入を阻止する最も簡単な方法は、SucuriやWordFenceのようなWordPressセキュリティ・プラグインを使うことだ。

WordPressのログインエラーメッセージからログインヒントを非表示にする方法について、この投稿がお役に立てば幸いです。最高のマネージドWordPressホスティングや WordPressセキュリティのエキスパートガイドもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

19件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Thomas Maier says

    Hello how can i translate the code above in different languages? I need it for the woocommerce login for the customers.

    • WPBeginner Support says

      You would want to change the ‘Something is wrong!’ text to the text you want but if you want the text to change into multiple languages, that would require a bit more coding than we would have for a beginner article. In that case you would want to take a look at multilingual plugins.

      管理者

    • WPBeginner Support says

      As long as the code is working on the desktop version you would want to reach out to WPTouch to let them know about that issue to take a look.

      管理者

  3. Anand says

    Well it is easy to know the username if it is right, as when entered correct username and the wrong password, the username field does not get blank even after getting the ‘something is wrong’ warning. Which clearly is a hint the yes this is the correct username. Is there any way to make the username field blank in this scenario. Please help.

  4. Shane says

    Is there a way to change the text of the error message on the lostpassword page that says by default, “Please enter your username or email address. You will receive a link to create a new password via email.”?

    I can’t seem to find any material on the subject

    • Nick says

      I was wondering the same thing. Why can’t we just change the wording of the error message instead of adding a function that might be overwritten with the next update?

  5. Paco says

    The only thing is that when you enter a correct username and an incorrect password, it gives a message “something is wrong” but you can see the username, which confirms it in case you have guessed it. I don´t know if this happens in WordPress 4.5. Is there any way of leaving the username field blank even though it´s correct? Thank you

  6. maudenicholson2 says

    I am curious to find out what blog system you’re using? I’m having some small security issues with my latest website and I would like to find something more safeguarded. Do you have any solutions?

  7. freyaewu73605919 says

    I am truly thankful to the owner of this web page who has shared this enormous article at at this time.

  8. Bob says

    WP Simple Firewall or Shield gives you the ability to hide the login menu, lock down the Dashboard and it comes with Sucuri and Brute Attack prevention. It is a free plugin, use it in conjunction with a password manager, so you don’t forget or misplace your passwords. I use Lastpass, which is also free. Shield replaced six security plugins and sped up my website.

  9. Phillip George says

    Is there a help line in Australia as I have forgotten my user name for logon being a little old it is a problem

    • Bob says

      G’day Phillip, sorry mate no help line. Try going through whoever hosts your website, they should be able to help you out. Once reset use a password manager like Lastpass, you only have to remember one password. WRITE IT DOWN; did I say write it down because if you don’t, WRITE IT DOWN you’ll really will be up the creek, without a paddle.

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。