I’m working on a plugin which has bulk post inserts using a spreadsheet. This spreadsheet can have multiple thousand rows, each row corresponding to a post. I’m parsing this spreadsheet, looping over the parsed data and using wp_insert_post to insert the posts. I noticed that when I used a spreadsheet with around 2000 entries, only around 600 posts were inserted.

Is there a limit on the number of wp_insert_post calls in one shot? Or could it be a limit on one shot mysql inserts?

(edited title for more clarity)

1 Answer
1

Something tells me that it could be the maximum script execution timing out perhaps. The amount of memory your inserts are consuming could also be the culprit. Are you getting any error messages, blank screens or anything like that?

You could try adding the following above where you’re calling the wp_insert_post() function:

set_time_limit(0);

Leave a Reply

Your email address will not be published. Required fields are marked *