Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Openverse
    • Mobile
    • Hosting
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • WordPress.tv
    • Developers
  • Community
    • Make WordPress
    • WordCamp
    • Meetups
    • Photo Directory
    • Job Board
    • Five for the Future
  • About
    • About WordPress
    • Showcase
    • Gutenberg
    • Enterprise
  • Get WordPress
Get WordPress

Developer Resources

Browse: Home / Reference / Functions / wp_shake_js()

wp_shake_js()

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

Contents

  • Source
  • Changelog
  • User Contributed Notes
    • Feedback

Source

File: wp-login.php. View all references

function wp_shake_js() {
	?>
	<script type="text/javascript">
	document.querySelector('form').classList.add('shake');
	</script>
	<?php
}

View on Trac View on GitHub


Top ↑

Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note
    Contributed by Benjamin Denis — 5 months ago

    login_footer is the correct action name to remove the shaking effect:

    function wpdocs_login_remove_shake_effect() {
        remove_action( 'login_footer', 'wp_shake_js', 12 );
    }
    add_action( 'login_footer', 'wpdocs_login_remove_shake_effect', 1 );
    Log in to add feedback
  2. Skip to note 2 content
    You must log in to vote on the helpfulness of this noteVote results for this note: -1You must log in to vote on the helpfulness of this note
    Contributed by Andrea Alba — 1 year ago

    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:

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

    Top ↑

    Feedback

    • Login_footer is the correct action name. — By Benjamin Denis — 5 months ago

    Log in to add feedback

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Swag
  • Documentation
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
  • Visit our Instagram account
  • Visit our LinkedIn account
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.