Title: wp_shake_js
Published: April 25, 2014
Last modified: May 20, 2026

---

# wp_shake_js()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#wp--skip-link--target)

Outputs the JavaScript to handle the form shaking on the login page.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#source)󠁿

    ```php
    function wp_shake_js() {
    	wp_print_inline_script_tag( "document.querySelector('form').classList.add('shake');" );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-login.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-login.php#L461)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-login.php#L461-L463)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_print_inline_script_tag()](https://developer.wordpress.org/reference/functions/wp_print_inline_script_tag/)`wp-includes/script-loader.php` |

Prints an inline script tag.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#comment-content-5999)
 2.    [Benjamin Denis](https://profiles.wordpress.org/rainbowgeek/)  [  4 years ago  ](https://developer.wordpress.org/reference/functions/wp_shake_js/#comment-5999)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%23comment-5999)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%23comment-5999)
 4.  `login_footer` is the correct action name to remove the shaking effect:
 5.      ```php
         function wpdocs_login_remove_shake_effect() {
             remove_action( 'login_footer', 'wp_shake_js', 12 );
         }
         add_action( 'login_footer', 'wpdocs_login_remove_shake_effect', 1 );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%3Freplytocom%3D5999%23feedback-editor-5999)
 7.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/wp_shake_js/?output_format=md#comment-content-5432)
 8.    [Andrea Alba](https://profiles.wordpress.org/subjuliodesign/)  [  5 years ago  ](https://developer.wordpress.org/reference/functions/wp_shake_js/#comment-5432)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%23comment-5432)
     Vote results for this note: -1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%23comment-5432)
 10. **Remove the Login Page Shake.**
      The login form shakes when the user submits 
     the wrong login credentials; if you don’t want this feature, you can remove using:
 11.     ```php
         function wpdocs_remove_login_shake() {
         	remove_action( 'login_head', 'wp_shake_js', 12 );
         }
         add_action( 'login_head', 'wpdocs_remove_login_shake' );
         ```
     
 12.  * Login_footer is the correct action name.
      * [Benjamin Denis](https://profiles.wordpress.org/rainbowgeek/) [4 years ago](https://developer.wordpress.org/reference/functions/wp_shake_js/#comment-5998)
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F%3Freplytocom%3D5432%23feedback-editor-5432)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_shake_js%2F)
before being able to contribute a note or feedback.