Change WordPress Login Logo And Url.

By default on wp-login.php page login logo is of WordPress icon as seen in screenshot.

On click on WordPress icon it will take you to the default wordpress offical site “https://wordpress.org”.

For Changing WordPress logo we have to override the default css of wordpress.for this we can use simple 'login_enqueue_scripts' hook
Example:

function ChangeLogo() { ?>
  <style type="text/css">
    .login h1 a {
      background-image: url(logo.jpg) !important;
      background-size: 100% !important;
      float: left;
      width: 100% !important;
    }
  </style>
<?php }
add_action( 'login_enqueue_scripts', 'ChangeLogo' );

This code only replaces the WordPress logo on wp-login.php page. It does not change the logo link which points to the Official WordPress.org website.

For Changing Link of Logo we need to use 'login_headerurl' filter.
Example:

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

null

Enjoy

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top