How to Remove the Login Shake From WordPress

If you’ve ever forgotten your password on a WordPress site, then you know that the box with the login form shakes when you enter a wrong password. I personally find this UI experience to be a bit startling and annoying. The red error box seems to be enough to get the message across without a jarring shake:

Here’s how you can remove the action for the javascript that makes the login form shake. Add this code snippet to your theme’s functions.php file:

function my_login_head() {
    remove_action('login_head', 'wp_shake_js', 12);
add_action('login_head', 'my_login_head');

This handy snippet comes to you courtesy Aaron Rowe-Jardine who posted at WP-Snippets, a great website to find and share WordPress code snippets. They’ve recently gone through a complete redesign, so make sure to stop by and check out the new site.

Certainly the wrong password login box shake gets users’ attention. If you like that, there’s no reason to remove it. However, if you find the login shake to be offputting, now you know how to remove it.