migration – How to add Featured Image on WXR from External Conversion
Question
I want to migrate data from old site into a new WordPress installation, as I convert everything as expected, I still could not set the featured image.
I’ve tryin to read How to add featured thumbnail into import XML? but still not achieving anything.
My Converted WXR look like this, I only add what essentials for me, I wonder if attachment metadata would be related to this problem or not.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2" 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>
<title>WordPress Site</title>
<link>https://wordpressurl</link>
<language>en-US</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://wordpressurl</wp:base_site_url>
<wp:base_blog_url>https://wordpressurl</wp:base_blog_url>
<item>
<wp:post_id><![CDATA[3]]></wp:post_id>
<title><![CDATA[Post Title]]></title>
<dc:creator><![CDATA[username]]></dc:creator>
<content:encoded><![CDATA[<img alt="Image alternative text." src="https://oldsite/picture/image.jpg">]]></content:encoded>
<wp:post_date><![CDATA[2023-02-27 00:00:00]]></wp:post_date>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_type><![CDATA[post]]></wp:post_type>
<category domain="category" nicename="category-name"><![CDATA[Category Name]]></category>
<wp:post_meta>
<wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key>
<wp:meta_value><![CDATA[300]]></wp:meta_value>
</wp:post_meta>
<category domain="post_tag" nicename="tag-name"><![CDATA[Tag Name]]></category>
</item>
<item>
<title><![CDATA[Picture: 300]]></title>
<wp:post_id><![CDATA[300]]></wp:post_id>
<wp:post_parent><![CDATA[3]]></wp:post_parent>
<dc:creator><![CDATA[username]]></dc:creator>
<wp:attachment_url><![CDATA[https://oldsite/picture/image.jpg]]></wp:attachment_url>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_type><![CDATA[attachment]]></wp:post_type>
<wp:post_name><![CDATA[picture-300]]></wp:post_name>
<wp:postmeta>
<wp:meta_key><![CDATA[_wp_attachment_image_alt]]></wp:meta_key>
<wp:meta_value><![CDATA[Somewhat caption here]]></wp:meta_value>
<wp:postmeta>
<wp:meta_key><![CDATA[_wp_attached_file]]></wp:meta_key>
<wp:meta_value><![CDATA[2023/03/image.jpg]]></wp:meta_value>
</wp:postmeta>
</wp:postmeta>
</item>
</channel>
</rss>
0
3 weeks
2023-03-05T06:26:42-05:00
2023-03-05T06:26:42-05:00 0 Answers
0 views
0
Leave an answer