Custom WordPress Login Logo Using PHP

Home / Code Scripts / Custom WordPress Login Logo Using PHP

Resource Type

Code Scripts

Complexity Level

Beginner

Last Updated

July 29, 2025

Description

This snippet allows you to replace the default WordPress login page logo with your own custom logo. Great for branding your client sites or personal projects.

PHP

				
					/**
 * Change WordPress Login Logo
 */
function rcwebkit_custom_login_logo() {
    ?>
    
        #login h1 a {
            background-image: url('/images/custom-logo.png');
            background-size: contain;
            width: 200px;
            height: 100px;
        }
    
    <?php
}
add_action('login_head', 'rcwebkit_custom_login_logo');

/**
 * Change Login Logo URL
 */
function rcwebkit_custom_login_url() {
    return home_url();
}
add_filter('login_headerurl', 'rcwebkit_custom_login_url');

				
			

Key Features:

  • Simple PHP snippet (no plugin required)

  • Custom branding for wp-login.php

  • Lightweight and clean

 

Steps to Use:

  1. Upload your logo to wp-content/themes/your-theme/images/custom-logo.png

  2. Add this code to your theme’s functions.php file.

  3. Refresh https://yourwebsite.com/wp-login.php.

Search

Connect with us

Blog Categories

recent posts

Scroll to Top