Change WordPress login page logo

WordPress displays its default logo on the login page by default. If you’re building a branded website or client project, replacing the WordPress logo with your own logo is a simple way to reinforce your brand identity. This snippet allows you to customize the login page easily without using heavy plugins.

/**
 * WP Snippet Press - Custom Login Logo
 */
function wpsnippetpress_login_logo() { ?>
    <style>
        #login h1 a {
            background-image: url('<?php echo get_stylesheet_directory_uri(); ?>/assets/images/logo.png');
            background-size: contain;
            width: 200px;
            height: 80px;
        }
    </style>
<?php }
add_action('login_enqueue_scripts', 'wpsnippetpress_login_logo');
PHP

Usage:

Add this code to your child theme’s functions.php file or a custom plugin. Update the logo.png path with your own logo image in the child theme’s /assets/images/ folder.

Benefits:

  • Branding – Display your own logo for a professional look.

  • Client Projects – Ideal for client websites to replace the generic WordPress branding.

  • Simple & Safe – Lightweight snippet with no impact on site functionality.

Frequently Asked Questions

Yes. Modify the width and height properties in the CSS section of the snippet to fit your design.
No. This snippet is safe. It only affects the login page styling and uses a child theme or custom plugin.
Yes. You can replace the logo.png path with a GIF or SVG. Just make sure your CSS background-size and dimensions are adjusted accordingly.

Related Links

Related Snippets

Display Gravity Forms Entries for the Logged-In User
Display Gravity Forms submissions for logged-in users on the frontend using a simple shortcode. Learn...
Hide WooCommerce Prices for Non-Logged-In Users
Hide WooCommerce product prices for visitors who aren’t logged in. It will encourage users to...
Picture of Kishan D
Kishan D
I’m a web developer who builds with WordPress, WooCommerce, and Shopify, and I enjoy exploring React and creating gaming & tech content.

SHARE POST

Leave a Reply