I need to import content (daily) from a xml file into wordpress. I am not looking for a specific answer, and I don't expect someone to write the whole code here, I just need some guidance on how to accomplish it.
I plant to:
- Write php script to load XML file with simplexml_load_file()
- Read the file with SimpleXMLElement()
- Put everything in a loop and use wp_insert_posts to create each post
- I am going to use ACF for custom fields, not sure if ACF has function to do that programmatically.
- Run everything with a cron job
Does the above seems logical? Or am I going about it the hard way. I would appreciate if someone with more experience importing XML files could give me some tips, or things to consider. Thanks.