I have a script that automatically makes posts and uses insert_post() to do so. Running the script works but after a few loops (running insert_post()) the script just ends without any warnings or errors after trying to run insert_post(). The last post is made and shows up in the database but the function insert_post doesn’t even return an id. The script just ends. I have no idea why.
I checked and all the inputs are the fine but it just stops after a few times. It is not a timeout issue either because I was running with no timeout.
It wasn’t happening yesterday but now it is. I didn’t change the script.
for(...) { $new_post = array(
'post_content' => $content,
'post_title' => $title,
'post_status' => 'publish',
);
$post_id = wp_insert_post($new_post); }
wp_insert_post never returns and the script ends
for
loop? How heavy are the content of your posts? and how much ram is available for your installation?