What is the required format for importing posts into WordPress?

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:excerpt="http://wordpress.org/export/1.2/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.2/" >

    <channel>
        <wp:wxr_version>1.2</wp:wxr_version>

        <item>
            <title>My first post</title>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <description></description>
            <content:encoded><![CDATA[
<p>Welcome to my first post!</p>
]]></content:encoded>
            <excerpt:encoded><![CDATA[]]></excerpt:encoded>
            <wp:post_date>2015-03-01 16:20:00</wp:post_date>
            <wp:status>publish</wp:status>
            <wp:post_type>post</wp:post_type>
        </item>

        <item>
            <title>My second post</title>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <description></description>
            <content:encoded><![CDATA[
<p>Welcome to my second post!</p>
]]></content:encoded>
            <excerpt:encoded><![CDATA[]]></excerpt:encoded>
            <wp:post_date>2015-03-02 16:20:00</wp:post_date>
            <wp:status>publish</wp:status>
            <wp:post_type>post</wp:post_type>
        </item>

        <item>
            <title>My third post</title>
            <dc:creator><![CDATA[admin]]></dc:creator>
            <description></description>
            <content:encoded><![CDATA[
<p>Welcome to my third post!</p>
]]></content:encoded>
            <excerpt:encoded><![CDATA[]]></excerpt:encoded>
            <wp:post_date>2015-03-03 16:20:00</wp:post_date>
            <wp:status>publish</wp:status>
            <wp:post_type>post</wp:post_type>
        </item>

    </channel>
</rss>

Leave a Comment