Sunday, February 1, 2015

Change all Posts Published Date in Wordpress


In Wordpress all blog or post save as current post time or set publish post as own date and time.According to publish date & time all post display as archive label `Publish on`. Also this useful for search result for own Website.
So when you chnage server or upload website from localhost to live server than its necessary to change all post publish date same as upload website on server date.
If you want to change a single post publish date than it's Manage from admin panel but when you want to change publish date for all post than must use PHPMYADMIN.
Here below describe two way for change post publish date.

1. From Admin Panel

  1. Login to your website's admin panel.
  2. Go to all posts page from left menu.
  3. Here display list of post select Quick Edit link which post you want to change date.
  4. Change that date and update post.

2. By Phpmyadmin

If you have Phpmyadmin details than change post publish date directly from database.
All post publish date save as `post_date` & `post_date_gmt` so open `wp_post` table and change that two column value for particular post.

3. By Mysql Query

If you are developer than it is easy for change post date by using SQL query in WordPress as below.

global $wpdb;
$wpdb->query("UPDATE `".$wpdb->prefix."posts` SET 
`post_date` = 'DATE(Y-m-d H:i:s)',
`post_date_gmt` = 'DATE(Y-m-d H:i:s)' WHERE `ID` = 'POSTID'");
 
Here Replace your post or page id instead of POSTID and set date as below format.Here if you want to change all pots publish date that you can do using loop.

No comments :

Post a Comment