Why doesn’t the WordPress Importer update posts?

One can see from the code on the WordPress Importer Plugin that it was a thought decision to bail early when imported posts had post_title and post_date matching existing posts.

For that reason, they don’t run the imported versions through wp_insert_post() which would update them accordingly. There are also no hooks to modify this behavior.

Does anyone know a of a clear reason for this? Was it just a decision-not-options design or are there’s any hidden gotchas that could creep from that sort of repurposing?

I’m trying to decide wheter I’ll send in a patch adding that hook or actually fork this and build my own version without that restriction, so it would be handy to know.

2 Answers
2

I can see both sides of the coin in the situation and they are reasonable.

If you are interested in this feature for this plugin and the plugin otherwise meets your needs, I would say re-write the section of the plugin which handles this evaluation and add in the allowance for an optional argument (boolean in this case should be fine) that acts as a flag to either omit or overwrite and propose it to the plugin author (assuming they are actively maintaining it). While temporarily maintaining your own, customized version

Leave a Comment