Increasing logged-in expiry time of your wordpress website

Increasing logged-in expiry time of your wordpress website

Why Increase Loggin-in Expiry Time

Sometimes while developing a wordpress website, you dont want wordpress to log you off automatically from the website you are working on or in an other case, you might want to increase log-in expiry timer for your website’s users. Here’s a tiny piece of code that you can copy and paste into your functions.php file to help achieve the goal.

Source Code

add_filter( 'auth_cookie_expiration', 'loggedin_for_10days' ); 

function loggedin_for_10days( $expire )
{
  return 864000; // 10 days in seconds 
}

 

You can reach Waqas Yousaf through twitter @wiqi.
Share

Waqas Yousaf is Freelance Web Developer, Blogger, start-up manager and Co-Founder of wishdd.com.

Comments

  1. I don’t leave loads of comments on plenty of blogs but i felt i had to here.
    Quality articles you have here.

Leave a Reply

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

4 + six =