Currently I am looping over 3 thousand times in order to insert posts using the wp_insert_post()
etc.
All these queries are a lot of hopping forward and back to the MySQL database. Do you know if it is possible to bulk all these queries as one query?
Thanks in advance.
One idea would be to format all the posts you would like to insert in the WordPress eXtended RSS (WXR) file format.
If you manage, then you can load all the posts in one shot using the built-in WordPress import utility.