WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Before I update a Wordpress install (including the theme and various plugins) I wanted to ensure no one is logged in and editing the site.

Is there a way to do this?


share|improve this question
up vote 1 down vote accepted

Because of the stateless nature of webpages, you can't do this without a high margin of error.

You can install a plugin to log last visits for logged in users, but that will not tell you if they're editing posts or if they loaded a page then went to lunch or shut down their computer.

Instead, use maintenance mode and arrange beforehand when to update the site. Anybody who wants to make edits or modifications at those times knows theres a chance it will be lost and they do so at their own risk.

share|improve this answer
Thanks Tom. I guess I will have to arrange a time. I may also consider trying to send some kind of admin notice in the backend, as described wptheming.com/2011/08/admin-notices-in-wordpress – Caroline Elisa Oct 5 '12 at 17:29
An admin notice is a great idea – Tom J Nowell Oct 5 '12 at 19:06

WordPress doesn't provide a built-in way to see a currently logged in user, but this plugin may help: WP Last Login.

Using this plugin you'll log the datetime of your users' login. The plugin appears to provide a column with the last login date... But you'll be wanting to see the actual time I imagine. If there's no way to format that, you can just inspect the database (before you update) and see if anyone's "last login datetime" is within the last few minutes or so.

share|improve this answer
Thanks Jared for your prompt reply. I believe Tom's answer was just a bit more helpful. – Caroline Elisa Oct 5 '12 at 17:30

Maybe the conditional functions help you

if ( is_user_logged_in() ) {
    echo 'Welcome, registered user!';
} else {
    echo 'Welcome, visitor!';
share|improve this answer

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.