How to remove Remember Me function from your login page

Sometimes you can help yourself by making some processes automatic. For example, if you are working from home, you don’t have to enter your username and password every time you need to log in. You can leave your information stored in a browser by simply clicking on Remember Me checkbox.

And if you do that, we have shown you how to automatically check that option. This way, your login will be remembered and you won’t have to deal with the login form every time you try to access your site.

On the other hand, if you have to work away from home or if you have many authors who work from public places, you might want to take security into your hands. Among many other things which can help you secure a website, you might want to completely disable the “Remember Me” function so that you don’t leave your login information on a public computer by mistake.

Although there isn’t a standard option in WordPress which will allow you to remove the function, you can do that in the next minute or so. All you need is a simple code snippet which you need to paste into your theme.

Remove the Remember Me function:

  1. Find functions.php file in your theme’s folder and open it
  2. Copy and paste the following snippet:
  3. add_action('login_head', 'do_not_remember_me');
    function do_not_remember_me()
    {
    echo '<style type="text/css">.forgetmenot { display:none; }</style>';
    }
    
  4. Save changes

This function will hide the checkbox and force you and your other users to log into the website each time they use it. Of course, you can still store your information in the browser but you will at least have to click the “Log in” button.

Now that you have c/p the function, you are free to log out and see what the result of the function is. If you have done everything correctly, “Remember Me” checkbox should be hidden and therefore disabled. You can now use your login details on a public computer and be a little bit more relaxed about it. Of course, there is a ton of different things to be careful about so don’t relax too much just because you have removed the “Remember Me” checkbox.

If you want to control login options with a plugin, check out what you can do with Remember Me Controls plugin for WordPress.

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

Leave a Reply

Your email address will not be published. Required fields are marked *