Importing Content

WordPress currently supports importing data in the form of posts (articles) and most of the details or features supported by the content publishing platform.

Many of the following Content Import scripts can be found under Tools → Import menu of your WordPress administration interface.

If you run into specific problems, a search on the WordPress Support Forum will likely lead to a solution, or try the Codex FAQ. Users of a blogging system not listed here who wish to switch to WordPress are invited to ask for help in the WordPress Support Forum as well.

To help you understand the differences between WordPress and other existing software, we recommend you review the WordPress Features and more on Working with WordPress.

Before Importing

If your exported file is very large, the import script may run into your host’s configured memory limit for PHP.

A message like «Fatal error: Allowed memory size of 8388608 bytes exhausted» indicates that the script can’t successfully import your XML file under the current PHP memory limit. If you have access to the php.ini file, you can manually increase the limit; if you do not (your WordPress installation is hosted on a shared server, for instance), you will have to break your exported XML file into several smaller pieces and run the import script one at a time.

If the import process is run again with the same data file after stopping midway through, it could result in duplicate data, missing data or other errors in the destination database.

For those with shared hosting, the best alternative may be to consult hosting support to determine the safest approach for running the import. A host may be willing to temporarily lift the memory limit and/or run the process directly from their end

Importing from [X]HTML

Using trial and error one can make an e.g., perl script to concatenate [X]HTML files as RSS <item>s, saving into a single file.xml, then import that as RSS. Note however to first remove any newlines between <p>..</p>s, as mentioned above.

The format allowed is quite simple in fact. Just make each HTML file into an <item> as below and concatenate them together:

[xml]
<item>
<pubDate>Wed, 30 Jan 2009 12:00:00 +0000</pubDate>
<category>Kites</category>
<category>Taiwan</category>
<title>Fun times</title>
<content:encoded><p>What great times we had…</p><p>And then Bob…</p></content:encoded>
</item>
<item>…
[/xml]

Just be sure the <content:encoded> line is a single long line with no newlines embedded.

If your HTML is well-formed, you can try using the Import HTML plugin.

Importing from a Site of Static Pages

discussion in February 2011 on the wp-hackers email list involved importing 6,000 static pages into WordPress. A number of responses recommended using the PHP Simple HTML DOM Parser to facilitate the porting of the pages.

Google Blog Converters

In case the above methods don’t work, you can try Google Blog Converters.

This tool can convert Blogger export into WordPress format. It also supports conversion from Movable Type & LiveJournal to Blogger format. You can take the Blogger format then convert it again into WordPress format.

Was this article helpful?

Related Articles

Leave A Comment?