Art of Coding

Web development tips and tricks

  • WordPress
    • Multiple post images
    • Social Sharing
  • Php
  • Javascript
  • Networking
  • Linux / Unix
  • Git
  • Get in touch

Redirect user on failed login in wordpress

On April 22, 2015 By Ankit Tiwari In Wordpress Tips and Tricks

Often we come across the situations when we need to redirect a user to a particular page if the login attempt was failed.

This can be done by using following simple snippet

// use the hook 'wp_login_failed'

add_action( 'wp_login_failed', 'at_login_failed' );
function at_login_failed()
{
wp_redirect( $url ); // url to redirect to
exit;
}

Recent Posts

  • Configure xdebug in docker to use with netbeans February 19, 2021
  • Share files between iPad and Windows PC January 31, 2020
  • WP CLI error “No such file or directory” January 18, 2020
  • WordPress file upload with AJAX May 15, 2019
  • A simple way to encrypt/decrypt data in php November 27, 2018

Categories

  • General PHP Tips
  • Git
  • Javascript and jQuery
  • Linux Tips
  • Networking
  • Wordpress Tips and Tricks

Copyright All rights reserved