81 Billion

Websites in Singapore that are highly effective and visually appealing

Changing the error message in wordpress making it more secure

Posted on | March 19, 2013 | Comments Off on Changing the error message in wordpress making it more secure

To tighten security, change the error message when a wrong username or password is entered into wordpress so that it doesn’t hint which is wrong.

add_filter(‘login_errors’,’login_error_message’);

function login_error_message($error){
//check if that’s the error you are looking for
$pos = strpos($error, ‘incorrect’);
if ($pos === false) {
//its the right error so you can overwrite it
$error = “Invalid access information.
Please try again.”;
}
return $error;
}

Comments

    About

    This is an area on your website where you can add text. This will serve as an informative location on your website, where you can talk about your site.

    Subscribe to our feed

    Search

    Admin