I have several posts in an Microsoft Excel file (.csv/.xls). I want to know the appropriate format of the file to import into Wordpress.com.

Note: I do not need help to convert the csv format into xml. I just need to know the required format for feeding into Wordpress. Same approach should work for .org hosted blogs.

Currently I have extracted a Wordpress XML file from Wordpress with the necessary headers. I believe all I need to do is populate the below XML code for each new post.

What fields can be excluded? What fields can be left blank? An example of successfully imported file and code would be appreciated.

I have tried two imports into Wordpress that have been confirmed as successful however I cannot see either post? So I suspect something is wrong with my file.

      <title>   My Post Title   </title>
      <link>    My Post URL </link>
      <pubDate> Sun, 01 Jan 2012 00:00:00 +0000 </pubDate>
      <dc:creator>  Author  </dc:creator>
      <guid isPermaLink="false">    My Post WP URL  </guid isPermaLink="false">
      <description> My Post Description </description>
      <content:encoded> My Post Content </content:encoded>
      <excerpt:encoded> My Post Excerpt </excerpt:encoded>
      <wp:post_id>  My Post ID  </wp:post_id>
      <wp:post_date>    2012-01-01 00:00:00 </wp:post_date>
      <wp:post_date_gmt>    2012-01-01 00:00:00 </wp:post_date_gmt>
      <wp:comment_status>   Open    </wp:comment_status>
      <wp:ping_status>  Open    </wp:ping_status>
      <wp:post_name>    My Post Title   </wp:post_name>
      <wp:status>   inherit </wp:status>
      <wp:post_parent>  My Post Parent ID   </wp:post_parent>
      <wp:menu_order>   0   </wp:menu_order>
      <wp:post_type>    attachment  </wp:post_type>
      <wp:post_password>        </wp:post_password>
      <wp:is_sticky>    0   </wp:is_sticky>
      <wp:attachment_url>       </wp:attachment_url>
  • 1
    This question is not specific to wordpress.com. The XML file-importer is the same in the wordpress.com environment as it is in self-hosted WordPress. The XML structure for a file imported into a wordpress.com site is exactly the same as the XML structure for a file imported into a self-hosted WordPress install. Commented Jan 20, 2013 at 18:17

2 Answers 2


Here is an import file where only a few settings are used (although you may be able to exclude even more), which successfully imports three posts (tested on WP 4.2.2):

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
    xmlns:wp="http://wordpress.org/export/1.2/" >


            <title>My first post</title>
<p>Welcome to my first post!</p>
            <wp:post_date>2015-03-01 16:20:00</wp:post_date>

            <title>My second post</title>
<p>Welcome to my second post!</p>
            <wp:post_date>2015-03-02 16:20:00</wp:post_date>

            <title>My third post</title>
<p>Welcome to my third post!</p>
            <wp:post_date>2015-03-03 16:20:00</wp:post_date>


If you just need a known-good example of a WordPress XML import file, try the Theme Unit Test data XML file.

If the code in your Excel file is well-formed, you may also look at other options, such as importing (X)HTML.

If you want to see how WordPress actually constructs its "Extended RSS" (XML) file, see wp-admin/includes/export.php.

If you want to see how WordPress imports data, see wp-admin/includes/class-wp-import.php and the import plugin's wordpress-importer.php and parsers.php.

As for what data are actually required, I would assume that it is just anything that is a primary key in the database. But double-check the above two files to be sure.

  • Thanks. Are all fields required? And how do you treat encoded fields? <excerpt:encoded><![CDATA[Boats and reflections, Royal Perth Yacht Club]]></excerpt:encoded> Commented Jan 20, 2013 at 18:25
  • See updated answer. I'm not exactly certain what data would be considered as required. Check the linked import/export files for more information. Commented Jan 20, 2013 at 18:34
  • Suggested an edit, but since it was anonymous I'll leave a comment here too -- the actual importers are the two php files here: plugins.svn.wordpress.org/wordpress-importer/trunk Commented Sep 25, 2014 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.