Best approach for importing numerous posts from API data?

[ad_1]

I am attempting to creating a number of new posts on my site through data provided by an API. All in, there would be around 75,000+ new posts.

I had previously hooked into the init action and set the priority to 999 and ran a function that grabbed the data from the API and then looped through it all and used the wp_insert_post function to add the data to a new post.

Is there a better way to do this? I wasn’t certain if the wp-cli offered any capabilities for this.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer