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?
- Brand Identity – Show your brand instead of the WordPress logo.
- Professional Look – Makes your website stand out for clients and users.
- Consistency – Matches the rest of your website’s design and style.
- Better User Experience – Gives a clean and modern login page.
Code Explanation
- Custom Logo – The
background-imageproperty replaces the default WordPress logo with your logo. - Size Control –
heightandwidthdefine your logo dimensions. - Clickable Logo URL – By default, the logo redirects to WordPress.org. The filter
login_headerurlchanges it to your website homepage. - Logo Title Text – The filter
login_headertextchanges 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





