Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

zh-cn:导入内容

本文已被标记为未完成状态。您可以将其补充或翻译完整,以此帮助完善 Codex。

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.

百度空间(新版和旧版)

网易(163 Netease)博客

新浪(中文)博客

QQ空间(腾讯博客)

人人网(校内日志)

CSDN博客

搜狐博客

博客大巴Blogbus

天涯博客TianYa

点点轻博客DianDian

b2

The script for importing b2 posts to WordPress was included in the versions up to 1.5.2 (wordpress/wp-admin/import-b2.php).

b2evolution

There are currently two methods of importing a b2evolution install into Wordpress described in this section.

Direct Import Between Databases

A non-WordPress script for for importing from b2evo to WordPress 2.x is available (legacy importer for WordPress 1.x).

Instructions:

  1. Install WordPress
  2. Download file, remove .txt extension, and upload to your wp-admin directory
  3. Run the script and input your b2evo database name and password

Import via Movable Type Export Format

The second approach is to re-skin a b2evolution blog so that when its source is viewed it appears to be in the Movable Type export format. This approach, which should work for all versions of Wordpress, and all recent versions of b2evolution is described in full on this page.

Blogbus

Blogger

Users of WordPress 2.2 and above can import from Blogger. Earlier versions cannot import from Blogger because "New Blogger" was released by Google, invalidating all the old importers. Only WordPress 2.2 and later has support for "New Blogger".

If you haven't already, you must be using New Blogger and a Google Account on Blogger. If you are still using Old Blogger, the importer will not work, but there is a helpful online tool that converts legacy Blogger Atom exports into Wordpress WXR export files.

To start the Blogger importer, go to Tools → Import → Blogger.
For WordPress versions 2.0.2 to 2.6.5, go to Manage → Import → Blogger.

Also see the Google Blog Converters section below.

Blogware

To start the Blogware importer, go to Tools → Import → Blogware.
For WordPress versions 2.0.2 to 2.6.5, go to Manage → Import → Blogware.

Blosxom

CSV Files

dasBlog

Use Kavinda's BlogML to WordPress import module (ZIP file link), originally created by Rob Walling and Aaron Lerch.

Delicious links

Delicious XML Import plugin for WordPress

Dotclear

To start the Dotclear importer, go to Tools → Import → Dotclear.
For WordPress versions 2.0.2 to 2.6.5, go to Manage → Import → Dotclear.

Drupal

e107 CMS

There is a dedicated e107 Importer plugin available on WordPress official plugin repository. See there for the list of features.

Excel/CSV Spreadsheet

Gallery2

Gallery2 Importer plugin for WordPress

Greymatter

To start the Greymatter importer, go to Tools → Import → Greymatter.
For WordPress versions 2.0.2 to 2.6.5, go to Manage → Import → Greymatter.

Jogger.pl

There's a script that allows to import entries and comments from Jogger.pl - Polish, Jabber-powered weblog system. Comments and manual are in Polish (since Jogger is mostly polish), but if you have any questions, feel free to ask in comments on author's blog.

Joomla

LiveJournal

To start the LiveJournal importer, go to Tools → Import → LiveJournal (Version 2.7 and later. Older version requires exporting entries, so it's better to use the newer importer).

Also see the Google Blog Converters section below.

If you can't use the current API-based importer for some reason, you need to:

  1. Grab an older importer file (download it from the link at the bottom of this page).
  2. Save the file as livejournal.php and replace the one in /wp-admin/import/.
  3. Go to Manage → Import → LiveJournal.
  4. Export LiveJournal contents in XML format. Use their export tool, following the LiveJournal instructions here.

Live Space (MSN Space)

Mambo

See the Joomla section.

Motime - Splinder

These are brands of the blog hosting provider Tipic Inc.

Using a python script named Spleender, you can import the posts (not the comments), see an English case study or the full documentation in Italian.

You can import comments, posts and categories also using the WP Plugin Splinder/Motime Importer, see an English quick guide or the full documentation in Italian.

Pivot

There is a script: Importing posts from Pivot 1.2 with *Linux* server to WordPress

There is another script, which has been updated to work with WordPress 2.0: Pivot importer for WordPress. It tries to preserve users and categories.

However, Pivot also has an excellent RSS support and that WordPress can import RSS. Example.

Finally, the Pivot developers have provided an export script to the generic Movable Type (MT) import format. Then use the exported file as described under Movable Type below.

Plone

An article on how to migrate Plone content into Wordpress via Movable Type format.

Posterous

Use WordPress.com's Posterous importer, then export/import as a WXR (WordPress eXtended RSS).

PostNuke

Conversion script to migrate Postnuke 0.75+ to Wordpress 2.5+ Taxonomy Migrate from PostNuke to Wordpress. Detailed wizard to migrate topics, sections, posts & users.

Movable Type

To start the Movable Type importer, go to Tools → Import → Movable Type and TypePad.
For WordPress versions 2.0.2 to 2.6.5, go to Manage → Import → Movable Type.

Also see the Google Blog Converters section below.

Nucleus CMS

Radio Userland

Roller

You can fairly easily import data from Roller using the MovableType import script. First, you need to export your blog from Roller database, then use it to create entries in your new blog. Pictures you need to copy to appropriate content directory yourself. Modify the $user, $oldresources, $newresources, and $connection variables in a beginning of script, store it on somewhere on you web host where php execution is allowed, and you will get the dump of your Roller blog in MovableType Import format in return. You can just use wget to store it into file. Then follow the instructions for MovableType import...

  • Importing From Roller is complete and comprehensive. This should work for Roller pre-2.0 release. After Version 2.0, the comment table is changed to roller_comment. Just change the select statement to roller_comment.

Textpattern

The script for importing Textpattern CMS posts into your WordPress blog is located at wp-admin/import-textpattern.php.

Another script may be found on the WordPress Forum on this forum thread.

(Update March 31, 2007) The WordPress textpattern.php import script seems to be buggy. Therefore, another script (hack of the included one included in WordPress) and step-by-step importing instructions are to be found over here.

Tumblr

Tumblr has no export feature. You can import its RSS feed, or try one of the migration tools below.

  • Tumblr2wp Creates a WXR (WordPress eXtended RSS) file from your tumblr site which can be imported into WordPress.
  • Tumblr2wordpress.com Creates an XML with all the content, comments, tags and files that can be imported into WordPress. Not suitable for WordPress 3.0 or above.

Twitter

Twitter has no export feature. You can import its RSS feed, or try Twitter Importer for Wordpress or TweetDumpr.

TypePad

The Importing from Movable Type to WordPress works for TypePad blogs, too. The only difference is in the process of exporting entries from the TypePad blog. Once you have the exported entries, follow the instructions in Importing from Movable Type to WordPress to complete the import into WordPress.

Typo

vCard

There are some plugins for importing vCard users into WordPress.

  • WP-vCard - Import users from vCard file format. Works with populair websites such as linkedin and gmail.
  • TPC! vCard - Imports vCards. You can create new users from that information.

Vivvo

Vox

Use WordPress.com's Vox importer, then export/import as a WXR (WordPress eXtended RSS).

web-log.nl

WordPress

To import from a WordPress export file into a WordPress blog follow these steps.

  1. Log into that blog as an administrator.
  2. Go to Manage: Import (or Tools:Import in 2.7+)in the blog's admin panels.
  3. Choose "WordPress" from the list.
  4. Upload this file using the form provided on that page.
  5. You will first be asked to map the authors in this export file to users on the blog. For each author, you may choose to map to an existing user on the blog or to create a new user
  6. WordPress will then import each of the posts, comments, and categories contained in this file into your blog

Xanga

xanga.r is a program that parses xanga pages to get the post and comments. Then it can output them in the WordPress rss 2.0 xml format for WordPress to import.

Xanga Archives

If you had paid for Xanga Premium and saved your archive files before switiching to WordPress, an importer can be found here.

Yahoo! 360

Use WordPress.com's Yahoo! 360 importer, then export/import as a WXR (WordPress eXtended RSS).

Zoomblog

These are the instructions to import your posts from Zoomblog:

  1. Go to your Zoomblog account and export your blog data (it generates an XML file).
  2. Download the Zoomblog importer from here. Unzip it, and upload the file zoomblog.php to your wp-admin/import directory.
  3. Login into WordPress and go to Manage:Import:Zoomblog.
  4. Choose the Zoomblog XML export file and it should be done.

It imports all posts and comments, and creates new categories, though, unfortunately, there's no way to figure out the proper category name, so you'll have to edit them afterwards. It does not deal with multiple authors.

Importing from an RSS feed

2.0.x

2.0 introduced this as an option in the Admin menu under "Import".

First, save the RSS feed you wish to import someplace on your local machine. This would be the source and would come from the site that has the content you wish to import into your WP blog. A simple way to get the feed into a text file is to find the RSS link for that site, click it and view it in your browser, then copy/paste that to a text file. Or, of course, use your preferred tools.

Click the "Browse" button and navigate to the file containing the feed you wish to import and click "Import" to let it run.

Note: Depending on the feed and format, you may not get the entire thing loaded on the first attempt. One option is to determine how much got imported (Manage -> Posts) and remove those sections from your saved RSS file and then re-import. Lather, rinse, repeat as necessary.

Note that newlines will be converted to <br />. Therefore be sure there is no newlines between any <p>..</p>s.

Pre 2.x

WordPress also has a generic RSS importer, which you can find in your WordPress source at wp-admin/import-rss.php. If your current blogging system can export in a valid RSS format, you can import that into WordPress.

Importing the RSS data is done by running the import-rss.php script from the server. For security reasons you have to edit the script to point to the file where the RSS data is stored.

If you have your blog at http://example.com, you can place your file, for example oldblog.xml, in the wp-admin directory on your site.

Edit import-rss.php by changing the value of RSSFILE in the beginning of the script. After you have changed this, run the script by accessing the script with your browser, in this case you’ll go to http://example.com/wp-admin/import-rss.php.

If the script finds your file, a link marked Begin RSS Import occur, and by pressing this link the import will start.

The RSS data are now imported, and you can remove the RSS file and restore the script.

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:

<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>...

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

A 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.