Keep logged in on WordPress for a longer period

add_filter( 'auth_cookie_expiration', 'stay_logged_in_for_1_year' ); function stay_logged_in_for_1_year( $expire ) { return 31556926; // 1 year in seconds }
A very handy code snippet here, which allows you to stay logged in for a longer period of time. Paste the code to functions.php and update, if needed, the amount of seconds to stay logged in on line 3.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.