Keep updated with the latest Tutorials and Snippets
Subscribe
X

Paulund

  • Tutorials
  • Snippets
  • Resources
  • Archives
  • About
  • Contact

Set Remember Me To Be Always Checked

Updated: April 2nd, 2013 in Wordpress

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 "document.getElementById('rememberme').checked = true;";
}
?>

Share The Wealth

Tweet This +1 This Like This

Keep updated with the latest tutorials and snippets.

Join me on Twitter | G+ | Facebook

Learn Web Design, Coding & More. No Risk. No Contracts. Learn More
« Free Source Code Hosting For GitWeb Development With Sublime Text 2 »
Comment

Set Remember Me To Be Always Checked bit.ly/XQvxjF

— Paulund (@paulund_) March 28, 2013

Paulund, Get the Latest Web Deals