3

I want to remove WordPress logo from login and register page. I think I have to make some changes in .css file for this. So I want to know in which css file do I have to make the changes?

3

You can add a filter to login_head. As explained in the Codex, add this to your code:

function my_custom_login_logo() {
    echo '<style type="text/css">
    h1 a {background-image:url(http://example.com/your-logo.png) !important; margin:0 auto;}
    </style>';
}
add_filter( 'login_head', 'my_custom_login_logo' );
  • login_head is action, not a filter :) , however login_headerurl is filter ... – jave.web Jun 23 '17 at 13:57
  • topic starter asks to remove logo, not to replace... if he uses this, page will result a 404 error... – brobken Jul 31 '17 at 13:36
1

Go to your website Editor using > Appearance > Editor > function.php and add this before the last line "?>":

/* Remove WP logo from login page */

function custom_login_logo() {
    echo '<style type ="text/css">.login h1 a { display:none!important; }</style>';
}

add_action('login_head', 'custom_login_logo');
0

To remove the WordPress logo, paste the below code in functions.php of the theme directory.

function remove_logo() { ?>
<style type="text/css">
    .login h1 a { display: none; }
</style>
<?php }

add_action( 'login_enqueue_scripts', 'remove_logo' );
0

You don't need to go through the coding, use Custom Login plug-in to do that

0

You can replace the logo using built-in theme editor as explained in this post.

Step 1:

Login to your WordPress site as admin and go to Media -> Add New to upload a new image and copy the image url.

You can also upload your new logo to the theme’s images directory or you can create a new directory to upload the logo. This can be done with the help of web hosting control panel or FTP.

Step 2:

Go to the Admin Dashboard -> Appearance -> Theme Editor.

Step 3:

When the editor opens, find and select functions.php from the right side of the page and add the following code to the end of the page.

function my_custom_logo() { ?>
     <style type="text/css">
         #login h1 a, .login h1 a {
             background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png);
             height:100px;
             width:100px;
             background-size: 100px 100px;
             background-repeat: no-repeat;
             margin-bottom: 10px;
         }
     </style>
 <?php } 
add_action( 'login_enqueue_scripts', 'my_custom_logo' );

Replace logo.png with the name of the file you have uploaded. If you have uploaded the new logo with WordPress, modify the background-image property as shown below.

background-image: url(url copied in step 1);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.