If you have the id of the posts, you can use wp_update_post and change the post_date.
foreach ($postId as $id) {
// random hour and time. You can also manually set these.
$h = rand(1, 23);
$i = rand(0, 59);
$newDate = array(
'ID' => $id,
'post_date' => "2013-12-19 $h:$i:59" // [ Y-m-d H:i:s ]
);
wp_update_post($newDate);
}
Related Posts:
- How to schedule multiple posts while adding new
- order posts by date like craigslist
- How to get the latest posting time of archived pages in WordPress?
- How to insert current date/time in the content of a post?
- How to get the date of a post in WordPress, so I could use it in a script?
- Automatically Updating Publish Date Bug
- How can I show many posts an author has per week?
- If modified on same day, show only time
- Prevent scheduled post being published if date/time is past current date/time
- Automatically add date to the auto generation of post slug
- How i can limit period of post publication?
- Changing default WP-Site creation date
- tribe_get_start_time displays the current date and time on other post types than tribe_events
- Get the most recently modified post date of most recently modified post
- How to show different timestamp
- Date is wrong on ‘all posts’ page
- Access last visit time to a post
- Post navigation using date
- Bulk update published posts date randomly using wp-cli?
- How do you update post date (year only) in a separate custom field?
- How to handle dates, trying to calculate time since a post
- date_query returning only the most recent post instead of the post published before today
- How to order posts in an arbitrary order?
- Trying to alter the post_content through the_post
- Automatically create a new page daily with last three posts
- Add filter to the end of the post
- save_post hook is not called when post is saved
- Howto show comment count by post in post?
- How to add a class to each individual post?
- Indirect modification of overloaded property WP_Post::$ancestors has no effect
- How do I change the location of post-specific information?
- Adding a user’s ID behind the tag ref link address
- One post out of more than twenty shows odd picture (from post) in the header
- ACF to select posts not displaying on blog page
- Benefits to using semantic HTML in post content? [closed]
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- custom word in custom permalink structure
- Post filtering is returning blank page
- How can I insert a new markup element after 4 posts automatically? [closed]
- the_excerpt is displaying excerpts of every post
- Using wp_tag_cloud with only posts published in specific year
- How to remove “» (title of post or page)”?
- Extract wordpress posts content and category content
- Post: how to set created date after post has been published [closed]
- Display Featured Posts Grid on Static Page (Gazette)
- WordPress loop not working on static front page
- Sidebar on single.php not showing up
- remove all custom post created
- How to add a post class on every post. (on homepage)
- Get posts from current category?
- Archieve page, Advertisement Every 3 Posts
- How do I get the image that is submitted with a post, when I’m in the loop?
- How to output all taxonomy links from a custom post type in a menu?
- Separate blog and reviews categories
- Return records between two meta datetimes saved as strings
- Why is it recommended to insert JS through the theme, plugin, etc rather than in the post directly?
- Cannot create new posts or upload images using media manager
- How can i showcase all my galleries?
- How can I create a shortcode to show the number of posts of actual day?
- How do I change the template specifically for single posts?
- the wp_post_update isn’t working all the time
- I want to add the 10 most recent posts under a parent category on the main menu
- Auto inserted strange characters in wp post
- WordPress rest API get Posts parent by post ID
- Change the size of the featured image for post?
- Set featured image as hero image on each page
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- Get origin or context of a how a post got created and/or updated
- Change URL of previous posts and next posts link in WordPress
- WordPress weird behaviour on comments
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- The letter “i” appears capitalised even when I don’t mean to capitalise them
- post is not showing more than 3949 words
- I really need help… I am looking for a solution about 28hours
- Custom Post Type Rewrite URL
- I want to show recent post according to category of the post in single.php?
- Limit amount of categories displayed in a post
- Word /blog/ in slug post, problems in CPT. Solutions?
- How to add post under particular pages? Like website.com/page1/post1
- Posts content is display added with title, instead of content, using the_excerpt()
- WP_Query sort by meta_value_num or date
- Category and Posts in front page
- How do I get a certain set of posts from the database?
- How do I use slideToggle inside a wordpress post?
- Bulk posts from DRAFT Section
- Stop images from being displayed on the front-end of the site
- Facebook share thumbnail not showing until refreshed
- Posts tagged with a-new-tag does not appear
- Add something after all sticky posts in The Loop
- Customize search results to include custom posts and display in a specific template page
- How to show different categories in different pages?
- Query posts from a specific category and selected tag
- Set the limit to allow author when make post!
- Assign certain editors to certain posts
- hypher.js doesn’t work to IE and Chrome
- Custom Post Title as search term
- Order by ‘s’ using WP_Query()
- Adding a post to a page
- Password protection doesn’t prompt for password on pages
- How can I add Author’s phone number to wp profile and make it appear in wp-admin/edit.php columns