Forums

Remove login_footer Back to Site Link (12 posts)

  1. Rhand
    Member
    Posted 9 months ago #

    I want to remove the return to site link in the WordPress Login screen. I believe that can be done with an action or filter, but I have not been successful yet. Ideas?

    NB Checking code here at the moment: http://lab.yukei.net/wp-code/nav.html?wp-includes/default-filters.php.source.html

  2. Rhand
    Member
    Posted 9 months ago #

    Seems that there is one hook for login_footer, but that there is no real action that ads the footer link leading back to the home page. I found the code here on line 133 of wp-login.php:

    function login_footer($input_id = '') {
    	?>
    	<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php esc_attr_e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
    	</div>
    
    <?php if ( !empty($input_id) ) : ?>
    <script type="text/javascript">
    try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
    if(typeof wpOnload=='function')wpOnload();
    </script>
    <?php endif; ?>
    
    <?php do_action('login_footer'); ?>

    Main snippet I do not want to load and will probably hide with CSS as I do not see another way is:

    <p id="backtoblog"><a>/" title="<?php esc_attr_e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
  3. Rhand
    Member
    Posted 9 months ago #

    Added CSS to my Custom Login Plugin Custom CSS box:

    .login #nav a, .login #backtoblog a {color:white !important;}
    .login #nav a:hover, .login #backtoblog a:hover {color:white !important;}

    This until I find a way to not load or replace the earlier mentioned back home link on the login screen

  4. KardiWeb
    Member
    Posted 8 months ago #

    Added CSS to my Custom Login Plugin Custom CSS box:

    .login #nav a, .login #backtoblog a {display:none;}
    .login #nav a:hover, .login #backtoblog a:hover {display:none !important;}
  5. mkbain67
    Member
    Posted 3 months ago #

    Hi, I want to remove the "back to" link as well, but I don't want to use the custom Login plugin. Can you tell me what .css file I should put those two styles in?

  6. Rhand
    Member
    Posted 3 months ago #

  7. mkbain67
    Member
    Posted 3 months ago #

    Awesome - thanks very much; I am looking forward to finally getting my login page just like I want it!

  8. mkbain67
    Member
    Posted 3 months ago #

    I couldn't hide the "Back To" link without also hiding the "Lost Your Password" link.

  9. esmi
    Theme Diva & Forum Moderator
    Posted 3 months ago #

    Never edit WordPress core files!

  10. mkbain67
    Member
    Posted 3 months ago #

    Okey doke, I edited my post that had my "resolution".

    But after hours of research, I couldn't get it done any other way. I did save the original as a backup, in case it didn't work or broke something. But everything checked out smoothly.

  11. mkbain67
    Member
    Posted 3 months ago #

    I read about why core files should never be edited, and I appreciate your warning. I have saved the original file, and when I need to upgrade WP, I will re-upload it. Thanks.

  12. Erik
    Member
    Posted 1 month ago #

    Hi,I am trying to achieve the same without much of CSS and PHP editing.
    Can you please tell me the safest way to remove the "Back to" link?

Reply

You must log in to post.

About this Topic