Import a large collection of email messages as WordPress posts

80 views Asked by At

We have a large collection of email messages written over the years on a discussion mailing list. They're in an .mbox file, but could be converted to another format if needed.

We'd like to publish those old mail messages as an archive of WordPress posts (one post per mail message). It would also be a good idea to have mail addresses in those messages hidden to avoid spam. How could this be accomplished?

1

There are 1 answers

0
ns-coder On BEST ANSWER

Importing email as post seems very unusual. Try reconsidering it and think about:

  • Post Status: Wouldn't recommend leaving it published.
  • SEO/Sitemap: If you're using plugins like Yoast that creates a sitemap, I would recommend removing it from sitemap which you can easily do from Yoast plugin
  • WP JSON API: make sure it isn't available publicly in wordpress API.

If you must do it:

I would recommend using WP All Imports plugin. The data must be in either XML or CSV. It might also support XLS. You should convert it to one of those format before you can import the data as posts.

Word of warning with CSV: because CSV is a Comma Separated any comma in your email (which is very common), will break the layout of CSV. Easiest way to get around this is to use a separator other than comma; you can use a combination of characters which will be very uncommon in email.

Example: Instead of using something like following:

value1, value2, value3, value4

Try using:

value1 ~!~ value2 ~!~ value3 ~!~ value4

You can then specify your separator in WP ALL IMPORTS when importing.