Bulk Updating Post Date in 1 day Increments

You could start from today and just work backwards, one day at a time: $start_hour = 8; $end_hour = 17; $date = new DateTime; foreach ( $posts as $post ) { $time = sprintf( /* Left-pad time values with zeros to two digits */ ‘%02d:%02d:%02d’, /* Random hour between start and end */ rand( $start_hour, … Read more

database optimization and server errors

It probably is a host issue. Assuming that you’re relatively stock WordPress, the queries shouldn’t be so inefficient that they’re causing timeouts. When it says a “remote mysql database”, does that mean a remote database server with the same hosting company, or does it mean you’re using a database server that’s physically located somewhere else? … Read more