Created
February 7, 2014 03:49
-
-
Save thinkclay/8857122 to your computer and use it in GitHub Desktop.
Navicat Function to update Wordpress Post dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN | |
SET @ID = 1; | |
WHILE @ID < 100 DO | |
UPDATE wp_posts SET comment_count = (SELECT COUNT('ID') FROM wp_comments WHERE comment_post_ID = @ID) WHERE ID = @ID; | |
SET @ID = @ID + 1; | |
END WHILE; | |
UPDATE wp_posts SET post_date = (SELECT FROM_UNIXTIME(post_time)); | |
UPDATE wp_posts SET post_date_gmt = (SELECT FROM_UNIXTIME(post_time)); | |
UPDATE wp_comments SET comment_date = (SELECT FROM_UNIXTIME(comment_time)); | |
UPDATE wp_comments SET comment_date_gmt = (SELECT FROM_UNIXTIME(comment_time)); | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment