words | WordPress Login Logo Link

Redirect logo URL and amend link title

In a previous "article", how to style the WordPress login/logout page, we changed the WordPress logo that sits above the login form to maintain brand consistancy.

The logo is also a link, and by default links to wordpress.org. We can change this link to direct to our front "home" page.

Place this code snippet inside functions.php

function custom_login_logo_url(){ 
    return home_url('/'); 
} 
add_filter( 'login_headerurl', 'custom_login_logo_url'); 

We also need to change the title which is displayed when we hover over the logo.

Place this code snippet inside functions.php, too

function custom_login_logo_title(){
    return get_option('blogname');  
 }
 add_filter('login_headertitle', 'custom_login_logo_title');

The above snippet displays only the WordPress project name but we can change it to display whatever title we like

function custom_login_logo_title(){
     echo 'Return to home page';  
  }
  add_filter('login_headertitle', 'custom_login_logo_title');