How to Change WordPress login page logo

How to change WordPress login page logo and URL without any plugin? Here is how we changed the default WordPress logo URL on the login page of BDLinks .Net. While there are plugins available for this, we will provide a quick code snippet that you can use to change the login logo URL in WordPress. If you want to use a plugin, you can do a Google search and find many options.

Table of Contents

How to Change WordPress Login Page Logo & URL Without Plugin

You can change the default WordPress login page logo image with some PHP and CSS code. It also allows you to modify the logo’s width, height, bottom margin, and URL. WordPress adds its logo to the login page by default. However, I believe you should add your branding here by changing the default login logo and the URL of the logo to the homepage.

Instructions to Change the Logo & URL

To begin, upload your custom logo to the media library. Now copy the image URL and paste it somewhere useful, such as Notepad. Let’s add the code below to your Child Theme’s functions.php file. It shouldn’t be used in the main theme because updating the theme file will also replace the code.

The WordPress logo is only replaced by this code. It has no impact on the login page logo link, which we will replace with another code.

function bdlinks_login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(ADD-YOUR-LOGO-URL);
        height:100px;
        width:100px;
        background-size: 100px 100px;
        background-repeat: no-repeat;
        padding-bottom: 0px;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'bdlinks_login_logo' );

Don’t forget to add the background-image URL inside the bracket that you copied earlier. You can also adjust other CSS properties to match your custom logo image. Change your logo height, weight, and margin, or do what you need to make it perfect.

Change the WordPress login page logo URL

Get custom logo url on WordPress login page. Simply copy and paste the following code into your theme’s functions.php file. To change the logo image, paste it directly below the code you added.

function bdlinks_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'bdlinks_login_logo_url' );
  
function bdlinks_login_logo_url_title() {
    return 'Your Site Name';
}
add_filter( 'login_headertitle', 'bdlinks_login_logo_url_title' );

Replace ‘Your Site Name’ with the name of your website. The custom logo on your login screen will now link to the home page of your website. If you have any problems or do not understand something, or if anything we have shared is incorrect, please leave a comment below.

2 thoughts on “How to Change WordPress login page logo”

Leave a Comment

Your email address will not be published.