Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

 <Item>     
      <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>
 </Item>        
share|improve this question
1  
Questions regarding wordpress.com are outside the scope of WPSE. See the wordpress.stackexchange.com/faq –  songdogtech Jan 20 '13 at 17:52
    
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. –  Chip Bennett Jan 20 '13 at 18:17
add comment

1 Answer

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.

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.

share|improve this answer
    
Thanks. Are all fields required? And how do you treat encoded fields? <excerpt:encoded><![CDATA[Boats and reflections, Royal Perth Yacht Club]]></excerpt:encoded> –  sparknlaunch Jan 20 '13 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. –  Chip Bennett Jan 20 '13 at 18:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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