• Skip to main content
  • Skip to primary sidebar
  • Business
  • WordPress
  • Security
  • Marketing
  • Publicity
  • Computing
  • Resources
  • Whatevs

Purely Wordpress

Just The Tech, News, and Info We Deem To Post

  • Home
  • About
  • Contact
  • Contribute
You are here: Home / Code Snippets / Change WordPress Login Page logo

Change WordPress Login Page logo

Screenshot of WordPress plugin php and html code

Add the following code to your WordPress theme’s function.php file, or a functionality plugin to Change WordPress Login Page logo.

Change Style

<?php

function my_login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png);
            padding-bottom: 30px;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );

Enque the Stylesheet

<?php

function my_login_stylesheet() {
    wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
    wp_enqueue_script( 'custom-login', get_stylesheet_directory_uri() . '/style-login.js' );
}
add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );

Change the Title

<?php

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

function my_login_logo_url_title() {
    return 'Your Site Name and Info';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );

by Jack Alltrade on September 6, 2022

Filed Under: Code Snippets Tagged With: WP Core

Reader Interactions

Share Your Two Cents Cancel reply

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

Primary Sidebar

Categories

  • Code Snippets
  • Development
  • File Management
  • Genesis Framework
  • Hosting
  • Legacy
  • Plugins
  • SEO
  • Tech Terms
  • Themes
  • User Experience
  • User Interface
  • WordPress Core
  • WordPress Functionality

Warning! Use at your own risk!

As always, use at your own risk and remember to backup your site prior to inserting new code.

© Copyright Jack Alltrade & Associates 2025 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates