Wodpress XML Import hooks

This is slightly complicated. I could think of 3 ways to do this:

  • Use someone else’s importer plugin. Importing stuff into WP using complicated criteria is a solved problem. However, I’ve never met an importer plugin that I liked which was free. Most of the projects I work on have less cash and more developer hours, but if yours doesn’t, this is going to be the easiest.
  • Modify the XML. There are a few ways to do this. You could write code to do this. It’s always better to parse XML semantically rather than as strings (and there are many libraries to help) but most people still do it as strings. You could do it with XSLT. You could also just munge it in with Excel. I’ve done all three at some point and this qualifies as an ETL task. ETL tasks always start off as really simple and usually end as complicated.
  • Hook the importer. There are some hooks already. This ticket in Make seems to have been included since 3.4.1 and says it included a bunch of hooks that could be useful for you, like wp_import_posts. Either way, you’re going to need to write code in some plugin. This would take care of much of the ETL complexity since at least some of the import stuff is already taken care of.

Choose your path… if it’s one of these, add a comment and I’ll try to help you more.