How To Change The Logo Image and Link on WordPress Login Page in an Oxygen Website

Amanda Lucas
on
December 14, 2021

Easily change the default WordPress logo and link on the WordPress login page.

wordpress login

Clients love seeing their logo when they login to their site.

With the help of some wise people in the WPDevDesign Facebook Group, the following code snippet lets you easily change the standard WordPress logo and link on the login page.

From this
To this

Add the following code snippet and set to run everywhere.

You only need to change the URL of the logo you want to show and adjust the width, height and background size to suit the aspect ratio of the logo.

function login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(https://yourwebsite.com/wp-content/uploads/2021/12/logo-file.png);
			background-position: center center;
			height: 90px;
			width: 90px;
			background-size: 90px;
			object-fit: cover;
			
}
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'login_logo' );
//Custom logo URL
function login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'login_logo_url' );
function login_logo_url_title() {
    return 'Link title';
}
add_filter( 'login_headertitle', 'login_logo_url_title' );

Thats it! I hope you find this useful.

Leave the first comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Amanda Lucas

Amanda Lucas

Amanda Lucas runs a web design agency in Ireland called Itchy Fingers Design. She enjoys creating websites that help support business goals and growth and sharing her knowledge.