Show menu

Skip to content
  • Home|
  • About|
    • Contact|
    • Support this site|
  • Blog|
  • Archives|
    • WordPress|
    • Web Design|
    • Software|
    • Robotics|
    • LEGO|
    • Tutorials|
  • Plugins|
    • Code Snippets|
    • BuddyPress Security Check|
    • Post Formats|
    • Personal Email|
    • Bookmarks Shortcode|
  • Resources|
  • PortableApps|
    • Bricx Command Center Portable|
    • ColorConsole Portable|
    • NeXT Commander Portable|
    • QuickPHP Portable|

Shea Bunge

Google+ GitHub WordPress WordPress Stack Exchange Twitter Subscribe Contact
You are here: Home / Automatically remember your WordPress login password

Automatically remember your WordPress login password

Published on 27th August 2012

You probably visit the login page on your WordPress-powered website at least once a week; perhaps one a day. Although WordPress does not include any options to customize the login page to suit your needs or preferences, there are plenty of tutorials and plugins floating around. One of those plugins is Remember Me Checked, a free plugin by WPMU Dev, which automatically checks the ‘Remember Me’ checkbox on the login page. This is useful if you want to help prevent users from loosing their password or provide special options to logged-in users (i.e. a no ad version of your site). While having a plugin is all very well and good and makes it easier for newbie WordPress users, such functionality is easily accomplished with a simple code snippet:


if( ! function_exists( 'remember_me_checked' ) ) :

function remember_me_checked() {
	?><script type="text/javascript">// <![CDATA[
		function checkit() {
			document.getElementById('rememberme').checked = true;
		}
		window.onload = checkit;

// ]]></script><?php }
add_action( 'login_head', 'remember_me_checked' ); endif;

The snippet adds a script to the login page which will use JavaScript to check the “Remember Me” box. You can add this snippet to your site using my Code Snippets plugin, or (if you insist) by pasting it in your active theme’s functions.php file. Enjoy!

Share this:

Like this:

Like Loading...

Possibly Related Posts

  1. How to send visitors back to where they came from
  2. It’s spelled WordPress, not Wordpress
  3. Displaying shortcodes in WordPress
  4. Bookmarks Shortcode plugin updated to version 2.0!
Posted in Plugins, Tutorials, WordPress | Tagged Featured, WPMU | Leave a response

Post navigation

← Code Snippets has a new website There is no CSS4 →

Leave a Reply Cancel reply

About Me

Hi! My name is Shea; I'm a teenage Web developer. I specialise in WordPress and PHP code, and I make lots of cool open-source projects. Read more…

Stack Exchange

Combined Stack Exchange profile for bungeshea

Affiliates

ManageWP Dropbox .htaccess made easy Pippin's Plugins

Follow Blog via RSS

RSS Feed RSS - Posts

RSS Feed RSS - Comments

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 15 other subscribers

Copyright © 2013 Shea Bunge

Proudly powered by WordPress

Follow me on Twitter

My Tweets

Buffer

Be awesome on social media. Easily add great articles, pictures and videos to your Buffer and we automagically share them for you through the day!

Signup to Buffer using the button below and we'll both get awesome extras!

Signup to Buffer

Dropbox

Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

Signup to Dropbox using the button below and we'll both get 500 MB of bonus space (on top of the usual 2 GB)!

Signup to Dropbox

RSS The NXT Generation Robotics

  • Paper plane folding and shooting robot
  • LEGO MINDSTORMS EV3
  • Code for RoboCupJunior Rescue now available on GitHub
  • Everything you need to know about the ultrasonic sensor
  • RoboCupJunior Hobart Regional 2012: Round 1

RSS LEGO BrickFORCE

  • LEGO Minifigure Infographic
  • LEGO Star Wars 2013: First pictures finally!
  • LEGO Star Wars 2013: A sneak preview
  • Brixhibition Announced
  • A new look
  • Archives
  • About Me
  • Contact Me
  • Donate
  • Privacy Policy
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
%d bloggers like this: