Custom Logo for WordPress Login Page

by web
Published On:
custom logo in wordpress login page

Add a Custom Logo for WordPress Login Page

// Custom Login Logo. Made by WebNQ
function custom_login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url('<?php echo site_url(); ?>/your-logo.png');
            height: 100px;
            width: 320px;
            background-size: contain;
            background-repeat: no-repeat;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'custom_login_logo' );

// Logo link to home page
function custom_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'custom_login_logo_url' );

// Logo title change
function custom_login_logo_url_title() {
    return 'Welcome to My Website';
}
add_filter( 'login_headertext', 'custom_login_logo_url_title' );

By default, the WordPress login page displays the WordPress logo. While this is fine for most users, many website owners prefer to add their own logo to make the login page look professional and consistent with their branding. In this article, I’ll show you how to easily replace the default WordPress logo with your custom logo using a simple code snippet.

Why Change the WordPress Login Logo?

  1. Brand Identity – Show your brand instead of the WordPress logo.
  2. Professional Look – Makes your website stand out for clients and users.
  3. Consistency – Matches the rest of your website’s design and style.
  4. Better User Experience – Gives a clean and modern login page.

Code Explanation

  • Custom Logo – The background-image property replaces the default WordPress logo with your logo.
  • Size Controlheight and width define your logo dimensions.
  • Clickable Logo URL – By default, the logo redirects to WordPress.org. The filter login_headerurl changes it to your website homepage.
  • Logo Title Text – The filter login_headertext changes the hover text to “Welcome to My Website”.

Tips for Best Results

  • Use a transparent PNG logo for a clean look.
  • Recommended logo size: around 300×100 pixels.
  • Always use a child theme to avoid losing changes after updates.

Customizing the WordPress login page logo is a simple way to improve branding and professionalism. With just a few lines of code, you can replace the default WordPress logo with your own, giving your website a unique and branded login experience.

custom logo for WordPress login page, change WordPress login logo, WordPress login page customization, replace WordPress login logo, WordPress login logo without plugin, change WordPress login logo link

{ }
</>
function()
;
//
Author: Sai Gopal Gunturu | Founder of WebNQ

Leave a Comment