0

I've got a multi user site which has about 100 authors on it, 20 or so current, the rest no longer writing for the site.

I want to work out an easy way to look at the current authors and see the last time they updated the site. Just the date, no links etc. I've got a file of current authors, eg

John Smith Bill Brown Kate Jones etc

and for each one I want to get a date of last update, eg

10 Jan 2018 03 Jan 2018 12 Dec 2017 etc

Is there an easy way to do this?

Thanks!

  • Can you perhaps elaborate a bit on what you mean with "updated the site"? Are you referring to the last_updated value of a single site in the network or the last time a user edited a post or something? – swissspidy Jan 17 '18 at 16:34
  • So every post has a user ID attached to it. You could run a query that gets all posts for user with a certain ID and then order by the post publish date with the newest posts being displayed first. My MySQL query writing skills on the fly are not the best, but if I took ten minutes I could probably figure it out. Is that going in the direction that you need? So basically, you'd end up with a result for every user of the last published post that that user made. Is that the goal? – Brent Jan 17 '18 at 16:39
  • Swissspidy it was the latter (last time a user posted something) – Paul Golder Jan 17 '18 at 17:07
0

Ok, Paul, So I took a few minutes to figure this out (assuming this is where you're going with this):

Here's the MySQL query that will give you the latest post date, one user at a time:

SELECT post_date FROM wp_posts WHERE post_author = 1066 ORDER BY post_date DESC LIMIT 1

(The number "1066" is arbitrary and represents a specific User ID on the table that I was testing this. So you would replace this with a given user ID for the user that you want to determine their latest post submission. )

So this simple bit of MySQL you would use in a database manager (like PHPmyAdmin) on the SQL command screen. A better solution would be to create an admin page that you can access from the WordPress Admin that can then list all your users and their latest contributions side-by-side. But that query is the heart of what you're after, I think.

  • 1
    Thanks Brent! I will have a tinker about with it later and see if if I can get it to work. My php is pretty good, but my MySQL is less good. But looks like I can get what I need from it. – Paul Golder Jan 17 '18 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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