How to periodically roll back WordPress to a fixed point in time?

First take a SQL dump of the database in the state you want it. Then you’d write a script that accomplishes the following:

  1. Put the WP install into maintenance mode by creating a file in wp-content with the filename .maintenance and contents “Briefly unavailable for scheduled maintenance. Check back in a minute.” (or your preferred text)

  2. Drop all the tables and recreate them from your
    SQL dump.

  3. Delete /wp-content/.maintenance

Finally hook your script to a cron job in the interval you’re looking for. It’s best if this script runs completely independently of WP using a system cron job, because there are fewer moving parts and things that could go wrong than if you’re trying to do it from within a running WP environment.