Customize the login logo url in WordPress

As you may have noticed, WordPress links the logo displayed on the login page to  If you are designing websites to clients it doesn’t look nice to leave it as it is. It would make more sense to link the login logo to the homepage or to any other page on your website.

The following PHP code snippet is written to do just that. All you need to do is insert the code into your theme’s functions.php file without changing anything and it will do the magic.

Once your custom logo is clicked it will take the user to your website’s homepage.

add_filter( 'login_headerurl', 'wph_login_logo_url' );
function wph_login_logo_url( $url ) {
	$url = home_url( '/' );
	return $url;