I need to change the published year on all of a custom post type from 2010, to 2011.
What is the quickest way to do it? I have 200 entries, so manual would take hours!!
|
|
|
Rajeev Vyas is more or less correct... personally I think the best way to do this is to make a tiny plugin that will update all your dates when the plugin is activated. After updating the dates... delete the plugin and keep in mind that if you activate the plugin again all your dates will change again. So step by step: First create a new php file and add the appropriate header info so that Wordpress recognizes it as a plugin. Save this to your /wp-content/plugins folder. Here is an example:
Now in this newly created file create a function and tie it into your plugin activation hook. This function will take care of updating all your post dates.
Now write the 'plus_one_year_activate' function:
Save and go activate this plugin. Once activated... all your dates will change. After activating, delete this plugin so you don't accidentally add another year to your dates (your changes will persist even after you delete the plugin). Hope this helped. |
|||
|
|
|
May be you have to write code in plugin file and run... Use get_posts to get posts for your custom post type and then loop it. Inside loop use wp_update_post function to update post_date. Here is reference for wp_update_post http://codex.wordpress.org/Function_Reference/wp_update_post
|
|||
|
|
|
have you considered doing it in the database (for example using phpmyadmin)? |
||||
|