# Check "Remember Me" by Default

> Pre-ticks the "Remember Me" box on the login form so users stay logged in longer without having to remember to tick it.

- Type: PHP
- Runs: Run everywhere
- Category: [Login](https://wpide.com/library/category/login/)
- Tags: login, remember-me
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remember-me-checked-by-default/

## Code

```php
add_action( 'login_footer', function () {
    echo "<script>(function(){var box=document.getElementById('rememberme');if(box){box.checked=true;}})();</script>\n";
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Check "Remember Me" by Default" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
