WordPress

Set Remember Me To Be Always Checked

The WordPress login page has a checkbox that allows you to always be remembered when you login to WordPress. If you check this box and login successfully to WordPress a cookie will be saved on your computer to let WordPress know that you can bypass the login process.

This makes it really for people who use your site regularly as they won't have to login each time to have access to the admin area of WordPress.

By default the checkbox is always unchecked, so you have to select it each time. I prefer this to checkbox to be selected each time so I don't have to keep clicking on the login page.

Here is a snippet you can add to your functions.php file which will make sure that the checkbox is always checked when you go to the login page.

<?php
 
function login_checked_remember_me() {
    add_filter( 'login_footer', 'rememberme_checked' );
}
add_action( 'init', 'login_checked_remember_me' );
 
function rememberme_checked() {
	echo "<script>document.getElementById('rememberme').checked = true;</script>";
}
?>
Back to top ^

Join Paulund

  • Get access to 100s of premium tutorials and downloadable content
  • Members content consists of Premium WordPress plugins, CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
  • In-depth development tutorials
  • Priority tutorial requests
  • Priority email development support
  • No ads

Here at Paulund you'll find Web Development tutorials and snippets focusing mainly on PHP, WordPress and CSS. Members will get access to premium tutorials that go into more detail about development with these languages. You will also get access to downloadable premium content based on the tutorial.

Join Paulund

Leave a Reply

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