WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any page after 10mins, it will logout user and redirect to login page.Any Solution? Advance Thanks.

share|improve this question
up vote 14 down vote accepted

You just need to add your filter hook like this:

function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
    return $remember ? $expiration : 600;
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );

You can add it to your theme’s functions.php file.

share|improve this answer
Thank you.Exactly what i needed. – Monirul Islam May 12 '12 at 4:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.