Adjust error messages for logging into the WordPress admin panel

Last updated December 5th, 2023 22:52

Security is the alpha and omega of your website. There’s certainly nothing pleasant about spending days and hours creating a website, only for someone to attack and damage it. That’s why security in WordPress is an ongoing topic. Today, we’ll show you another way to enhance security further. Adjust error messages for logging into the WordPress admin panel using a simple snippet. I’ll show you how. And why should you actually do it? We’ll discuss that below as well.

Adjust error messages for logging into the WordPress admin panel

When logging into your WordPress, does this system tend to tell you exactly what you’re doing wrong? Did you enter the correct username but just got the password wrong? WordPress will tell you. It plainly states that the username is correct but the password is wrong. From a security standpoint, this isn’t a good feature. Why? Because it gives a potential attacker a clear message that they’ve got the username right. They just need to guess the password.

That’s why today, we’ll show you how to change this notification. Using a snippet, which is a short PHP code, we’ll make WordPress behave differently. Specifically, we’ll change the error message to “something went wrong.” This won’t tell the attacker anything, not even if they guessed the login and only have the wrong password, or vice versa.

Upravte chybové hlášky u přihlášení do administrace WordPressu

How do you insert code into your website?

Easily and securely. By using the WPCode plugin. You don’t need to know how to program or even search for scripts to insert the function. This plugin will comfortably and securely do all that for you. I’ve detailed the complete guide in this article: How to insert custom codes into WordPress.

You can check out the article. I’ve described in detail how both the plugin and snippets are used. Believe me, this plugin will come in handy for you constantly.

Adjust error messages for logging into the WordPress admin panel

Use the plugin mentioned above to insert this simple code into your website.

				
					function no_wordpress_errors(){
  return 'Something went wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
				
			

Conclusion

As you can see, adding the snippet itself is very simple. Specifically, this function once again slightly complicates the work for a potential attacker. And since adding the snippet will take you approximately 2 minutes in total, including the installation of WPCode, there’s no reason why you shouldn’t do it.

The website is created with care for the included information. I strive to provide high-quality and useful content that helps or inspires others. If you are satisfied with my work and would like to support me, you can do so through simple options.

Byl pro Vás tento článek užitečný?

Klikni na počet hvězd pro hlasování.

Průměrné hodnocení. 0 / 5. Počet hlasování: 0

Zatím nehodnoceno! Buďte první

Jak užitečný vidíte tento článek.

Sledujte mě na sociálních médiích.

Je mi líto, že pro Vás nebyl článek užitečný.

Jak mohu vylepšit článek?

Řekněte mi, jak jej mohu zlepšit.

newsletter

Subscribe to the Newsletter

Stay informed! Join our newsletter subscription and be the first to receive the latest information directly to your email inbox. Follow updates, exclusive events, and inspiring content, all delivered straight to your email.

Odebírat
Upozornit na
guest
0 Komentáře/ů
Vložené zpětné vazby.
Zobrazit všechny komentáře.

Pokud mi chcete napsat rychlou zprávu, využije, prosím, níže uvedený
kontaktní formulář. Děkuji.

Další Kontaktní údaje