WordPress.org

Forums

Remove login_footer Back to Site Link (13 posts)

  1. Rhand
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago #

  7. mkbain67
    Member
    Posted 1 year ago #

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

  8. mkbain67
    Member
    Posted 1 year ago #

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

  9. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Never edit WordPress core files!

  10. mkbain67
    Member
    Posted 1 year 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 1 year 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 year 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?

  13. rainbow2013
    Member
    Posted 11 months ago #

    how to remove plugin links from the wordpress login homepage

Topic Closed

This topic has been closed to new replies.

About this Topic