Customize the WordPress Login Logo with Your Branding

Problem/Use Case:

The login page shows the WordPress logo by default. You can replace it with your brand’s logo.

Snippet:

// Customize login logo
function custom_login_logo_style() {
    echo '
    <style>
    .login h1 a {
        background-image: url(' . get_stylesheet_directory_uri() . '/images/custom-logo.png);
        background-size: contain;
        width: 200px;
        height: 100px;
    }
    </style>';
}
add_action('login_head', 'custom_login_logo_style');

Explanation:

This changes the login logo to your own image located in your theme’s images folder.

Where to Place It:

In functions.php.

Bonus Tip:

Adjust the width and height to fit your logo dimensions.

Ndifon Luke
Ndifon Luke

Ndifon Luke is the founder & owner of Uncle Luke Digitals—a web design, digital marketing freelancer based in Bamenda, Cameroon. He has over 6 years of expertise in digital marketing and is very passionate about working with clients in achieving their business objectives.