您可以使用通用更新查询。与往常一样,在处理数据库时take a backup first.
这样,您的查询应该如下所示:
BEGIN; -- Start a transaction
UPDATE
wp_posts
SET
post_modified = <Your new date>
AND post_modified_gmt = <Your new date in GMT>;
SELECT * FROM wp_posts LIMIT 10 ORDER BY post_date DESC; -- See the 10 most recently authored posts, make sure their post_modified and post_modified_gmt looks good
COMMIT; -- Commit the changes to the database or
ROLLBACK; -- If things don\'t look right.
Edit: 在您的情况下,如果在PHP中执行此操作,
definitely 备份,然后
$sql
以上所有内容,除了
BEGIN
,
COMMIT
, 和
ROLLBACK
, 尽管我建议在命令行或GUI/web界面中执行此操作。