Firstly create a php file in root folder of wordpress directory
Include wp-load.php ->
<?php include "wp-load.php"; ?>
and
$posts = array(); /* hold loop posts in an array */
$j = 0;
for($i=1; $i<10; $i++)
{
$new_ date= mktime(23,31,0,9,2,2014); /* hour, minute, second, month, day, year */
$new_ date=date("Y-m-d G:i:s", $new_ date);
$new_post = array(
'post_title' => $title,
'post_content' => $text,
'post_status' => 'publish', /* or future*/
'post_date' => $new_date,
'post_author' => 1, /* author id*/
'post_type' => 'post', /* post type*/
'post_category' => array($category_id) /* you can use multiple categories so : array(1,3,5) */
);
$posts[$j] = $new_post;
$j++;
}
foreach ($posts as $postx)
{
wp_insert_post($new_post);
}