1add_filter('auth_cookie_expiration', 'expiration_filter', 99, 3);
2function expiration_filter($seconds, $user_id, $remember){
3
4 //if "remember me" is checked;
5 if ( $remember ) {
6 //WP defaults to 2 weeks;
7 $expiration = 14*24*60*60; //UPDATE HERE in seconds;
8 } else {
9 //WP defaults to 48 hrs/2 days;
10 $expiration = 2*24*60*60; //UPDATE HERE in seconds;
11 }
12
13 return $expiration;
14}