WordPress: How to change the login logo and its URL without a plugin

Saul Goodman September 15, 2019 Loading...

By default, on the login page, the logo is WordPress logo and it links to WordPress.org home page. This can make your site look less professional, especially it has multiple users.

Luckily, we can easily custom the WordPress login page. Add the pieces of code below to your functions.php:

// replace the WordPress.org url by your homepage url
add_filter('login_headerurl', 'my_login_header_url');
function my_login_header_url()
{
    return esc_url(site_url('/'));
}

// remove WordPress default logo
add_action('login_enqueue_scripts', 'my_login_script');
function my_login_script()
{
    ?>
<style type="text/css">
    body.login div#login h1 a {
        background-image: none;
        width: 300px;
        text-indent: 0;
        font-size: 35px;
        font-style: italic;
    }
</style>
<?php
}

// use your site name as the login page logo
add_filter('login_headertext', 'my_login_header_text');
function my_login_header_text()
{
    return get_bloginfo('name');
}

1

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Sim Douglas Recent comment authors
newest oldest most voted
Sim Douglas
Guest
Sim Douglas

navigate

Welcome to KINDACODE. Have a nice day and code well!