WordPress' command line tool WP-CLI has a post update command for editing individual fields of a specified post.
Two of the standard fields are post_modified
and post_modified_gmt
, (DATETIME fields in MySQL).
Despite setting them to an earlier date, as below, they are always updated to the current date, e.g.
wp post update 123 --post_modified="2017-12-31 23:55:55"
If I then use wp post get
or look at the actual DB, both fields will always show the wrong time, i.e. the time I ran the command rather than the specified time as expected, and in spite of the fact I believe I've entered it in the required format, 0000-00-00 00:00:00
.
Adding --debug
doesn't give me any useful extra info.
Am I missing something obvious?