Create new posts from external website.
-
I need to create new posts in an existing WP site using data returned from an external API call via a Cron job on the same server/domain as the WP site.
I can see that XML-RPC would be the way to go for this but I have not been able to find out how to also include tags and categories when creating the new posts.
Matching tags and categories are already present in the WP site.
So, I call an API and with the returned data I will format it ready for inserting into the wp_posts table. Part of the API data will also provide me with what categories the new post should be assigned so I need to include this with the new post creation function somehow.
Also, should I be concerned that the API may return in excess of 5,000 new posts?
Imagine you were importing library books from your local libraries API into your WP site as new posts and each had to be categorised appropriately, that’s basically what I need to do. And this API call has to be run daily.Any help much appreciated.
- The topic ‘Create new posts from external website.’ is closed to new replies.