Skip to content

Instantly share code, notes, and snippets.

@adamziel
Last active November 27, 2025 12:38
Show Gist options
  • Select an option

  • Save adamziel/d8eb737bec5b89b5e8e4a71d560a9d51 to your computer and use it in GitHub Desktop.

Select an option

Save adamziel/d8eb737bec5b89b5e8e4a71d560a9d51 to your computer and use it in GitHub Desktop.
URL Rewriting in WordPress importer demo

URL Rewriting in WordPress importer demo.

<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!-- on the site. For each author, you may choose to map to an -->
<!-- existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->
<!-- generator="WordPress/6.5.4" created="2024-06-10 12:29" -->
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/">
<channel>
<title>My WordPress Website</title>
<link>https://yummy-🍲-recipes.org/vegan/</link>
<description></description>
<pubDate>Mon, 10 Jun 2024 12:29:10 +0000</pubDate>
<language>en-US</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://yummy-🍲-recipes.org/vegan/</wp:base_site_url>
<wp:base_blog_url>https://yummy-🍲-recipes.org/vegan/</wp:base_blog_url>
<wp:author>
<wp:author_id>1</wp:author_id>
<wp:author_login><![CDATA[admin]]></wp:author_login>
<wp:author_email><![CDATA[[email protected]]]></wp:author_email>
<wp:author_display_name><![CDATA[admin]]></wp:author_display_name>
<wp:author_first_name><![CDATA[]]></wp:author_first_name>
<wp:author_last_name><![CDATA[]]></wp:author_last_name>
</wp:author>
<generator>https://wordpress.org/?v=6.5.4</generator>
<item>
<title><![CDATA["Yummy Recipes!!"]]></title>
<link>https://yummy-🍲-recipes.org/vegan/about-us/?p=1</link>
<pubDate>Fri, 11 Nov 2025 16:04:48 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">https://yummy-🍲-recipes.org/vegan/about-us/?p=1</guid>
<description></description>
<content:encoded><![CDATA[
<!-- wp:cover {"url":"https:\/\/yummy-\uD83C\uDF7E-recipes
.org\/vegan\/wp-content\/uploads\/photo.jpg","align":"left","id":761} -->
<div
class="wp-block-cover"
style="
background-image: url(&#104;ttps:&#x2f;&#x2f;yummy-\1f372-recipes.org&#x2f;vegan&#x2f;wp-content&#x25;2Fuploads%2Fphoto.jpg);
padding: 0;
"
>
<div class="wp-block-cover__inner-container yummy-🍲-recipes.org/vegan/-cover" style="padding: 30px; backdrop-filter: brightness(17%);">
<img
src="&#104;ttps://xn--yummy--recipes-vb87&#x6d;.org/vegan/wp-content/uploads/logo.svg"
/>
<h1>Yummy Vegan Recipes!</h1>
<p>You are on the official yummy-🍲-recipes.org/vegan site!</p>
<p>
Be careful – there is a phishing site you may mistake us for:
extra-yummy-🍲-recipes.org/vegan/.
Oh! And our email is: hello@yummy-🍲-recipes.org
</p>
</div>
</div>
<!-- /wp:cover -->]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>10</wp:post_id>
<wp:post_date><![CDATA[2025-11-07 16:04:48]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2025-11-07 16:04:48]]></wp:post_date_gmt>
<wp:post_modified><![CDATA[2025-11-07 12:28:55]]></wp:post_modified>
<wp:post_modified_gmt><![CDATA[2025-11-07 12:28:55]]></wp:post_modified_gmt>
<wp:comment_status><![CDATA[open]]></wp:comment_status>
<wp:ping_status><![CDATA[open]]></wp:ping_status>
<wp:post_name><![CDATA[yummy-recipes]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[_pingme]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_encloseme]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
</item>
</channel>
</rss>
{
"landingPage": "/2025/11/07/yummy-recipes/",
"steps": [
{
"step": "resetData"
},
{
"step": "importWxr",
"file": {
"resource": "bundled",
"path": "./content.xml"
}
},
{
"step": "mkdir",
"path": "/wordpress/wp-content/uploads/"
},
{
"step": "writeFile",
"path": "/wordpress/wp-content/uploads/logo.svg",
"data": {
"resource": "bundled",
"path": "./logo.svg"
}
},
{
"step": "writeFile",
"path": "/wordpress/wp-content/uploads/photo.jpg",
"data": {
"resource": "url",
"url": "https://raw.githubusercontent.com/adamziel/demo-content/1e6f3ef8a50c99d9e9119951bae692efb2a7bda7/kitchen.jpg"
}
}
]
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment