Import of .com posts breaking due to XML escape characters
-
I am trying to migrate a client’s site (https://markaray.wordpress.com/2020/02/14/how-do-you-scout/) from WordPress.com to a self-hosted installation. I used the Export function in WordPress to export the posts to an XML file.
When I import the posts into my self-hosted installation, WordPress is trying to escape any single and double quotes from the XML file by adding a \ character, which is causing issues.
The page I need help with: [log in to see the link]
-
I found this trac ticket (via a StackExchange answer) that seems to indicate a good place to start: https://core.trac.www.ads-software.com/ticket/14818
It looks like you can prevent the extra escaping on import by setting that filter to return false.
add_filter( 'force_filtered_html_on_import' , '__return_false' );
Have you confirmed whether the escapes are present in the exported XML? If changing that filter doesn’t work, then the source of the problem might also be in the export format. In which case, it would be best to ask WordPress.com’s support for help.
Thanks for the suggestion. I added that code to my theme’s function.php and re-imported the XML file, but the same issue occurred. The escapes are not present in the exported XML.
I will post to the WordPress.com support forum and see if anyone has any ideas there.
Sounds good. In the meantime, if you have some minimal example of XML that reproduces the behaviour and share it, I can try to help you find an import-side workaround.
- This reply was modified 4 months, 2 weeks ago by Sara.
I haven’t heard back from WordPress.com support. Below is a shortened version of the XML file that reproduces the issue.
<?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.com" created="2024-07-08 16:45"-->
<rss version="2.0" xmlns:excerpt="https://www.ads-software.com/export/1.2/excerpt/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:wp="https://www.ads-software.com/export/1.2/">
<channel>
<title>Mark Ray | Writer</title>
<link>https://markaray.wordpress.com</link>
<description>Thoughts about writing, Scouting, and writing about Scouting</description>
<pubDate>Mon, 08 Jul 2024 16:45:08 +0000</pubDate>
<language>en</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://wordpress.com/</wp:base_site_url>
<wp:base_blog_url>https://markaray.wordpress.com</wp:base_blog_url>
<wp:author>
<wp:author_id>4975509</wp:author_id>
<wp:author_login>markaray</wp:author_login>
<wp:author_email>[email protected]</wp:author_email>
<wp:author_display_name><![CDATA[Mark]]></wp:author_display_name>
<wp:author_first_name><![CDATA[Mark]]></wp:author_first_name>
<wp:author_last_name><![CDATA[Ray]]></wp:author_last_name>
</wp:author>
<generator>https://wordpress.com/</generator>
<image>
<url>https://0.gravatar.com/blavatar/08f96a061bacafa0003622e7d371db5364cb6d35a8d36e0071309f9dd0b28d42?s=96&d=http%3A%2F%2Fs0.wp.com%2Fi%2Fbuttonw-com.png</url>
<title>Mark Ray | Writer</title>
<link>https://markaray.wordpress.com</link>
</image>
<item>
<title><![CDATA[A New Adventure]]></title>
<link>https://markaray.wordpress.com/2014/01/28/11/</link>
<pubDate>Tue, 28 Jan 2014 13:36:36 +0000</pubDate>
<dc:creator>markaray</dc:creator>
<guid isPermaLink="false">https://markaray.wordpress.com/?p=11</guid>
<description/>
<content:encoded><![CDATA[After years of offering tips for Scout leaders and those planning Eagle Scout courts of honor, I'm moving in a new direction: this blog. The idea is simple: to let you access content when you want it and where you want it and to free me up to write about more than just running Scout troops and planning courts of honor (although those topics will remain important).
I hope you like what you see. Please send any comments via the contact form below.
[contact-form][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/][/contact-form]]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>11</wp:post_id>
<wp:post_date>2014-01-28 13:36:36</wp:post_date>
<wp:post_date_gmt>2014-01-28 13:36:36</wp:post_date_gmt>
<wp:post_modified>2014-01-28 15:53:35</wp:post_modified>
<wp:post_modified_gmt>2014-01-28 15:53:35</wp:post_modified_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>11</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password/>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="writing"><![CDATA[Writing]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[4975509]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_publicize_pending</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_g_feedback_shortcode</wp:meta_key>
<wp:meta_value><![CDATA[[contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/]]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_g_feedback_shortcode_855bf470d268a61503ec21a7f99a97a7cb551a8d</wp:meta_key>
<wp:meta_value><![CDATA[[contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/]]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_g_feedback_shortcode_atts_855bf470d268a61503ec21a7f99a97a7cb551a8d</wp:meta_key>
<wp:meta_value><![CDATA[a:17:{s:2:"to";s:17:"[email protected]";s:7:"subject";s:35:"[Mark Ray | Writer] A New Adventure";s:12:"show_subject";s:2:"no";s:6:"widget";i:0;s:14:"block_template";N;s:19:"block_template_part";N;s:2:"id";i:11;s:18:"submit_button_text";s:6:"Submit";s:14:"customThankyou";s:0:"";s:21:"customThankyouHeading";s:26:"Your message has been sent";s:21:"customThankyouMessage";s:30:"Thank you for your submission!";s:22:"customThankyouRedirect";s:0:"";s:10:"jetpackCRM";b:1;s:9:"className";N;s:9:"postToUrl";N;s:14:"salesforceData";N;s:12:"hiddenFields";N;}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_g_feedback_shortcode_d62c464153ad9a215e267c2465919460ee2cfd3f</wp:meta_key>
<wp:meta_value><![CDATA[[contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/]]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_g_feedback_shortcode_atts_d62c464153ad9a215e267c2465919460ee2cfd3f</wp:meta_key>
<wp:meta_value><![CDATA[a:17:{s:2:"to";s:17:"[email protected]";s:7:"subject";s:35:"[Mark Ray | Writer] A New Adventure";s:12:"show_subject";s:2:"no";s:6:"widget";i:0;s:14:"block_template";N;s:19:"block_template_part";N;s:2:"id";i:11;s:18:"submit_button_text";s:6:"Submit";s:14:"customThankyou";s:0:"";s:21:"customThankyouHeading";s:26:"Your message has been sent";s:21:"customThankyouMessage";s:30:"Thank you for your submission!";s:22:"customThankyouRedirect";s:0:"";s:10:"jetpackCRM";b:1;s:9:"className";N;s:9:"postToUrl";N;s:14:"salesforceData";N;s:12:"hiddenFields";N;}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title><![CDATA[How Do You Scout?]]></title>
<link>https://markaray.wordpress.com/2020/02/14/how-do-you-scout/</link>
<pubDate>Fri, 14 Feb 2020 13:22:46 +0000</pubDate>
<dc:creator>markaray</dc:creator>
<guid isPermaLink="false">https://markaray.wordpress.com/?p=2171</guid>
<description/>
<content:encoded><![CDATA[<a ><img class="alignnone wp-image-2178 size-medium" src="https://markaray.wordpress.com/wp-content/uploads/2020/02/hands-1314632-1600x1200-1.jpg?w=300" alt="" width="300" height="225" /></a>
Opposites may attract in romantic comedies, but in real life relationships can face major challenges when people disagree about finances, religion, values, and priorities.
The same is true in Scouting. Troops that look alike on the parade ground at summer camp may be different--sometimes very different--beneath the surface. Consider a few examples: Troop A offers a very full schedule of robust activities, while Troop B holds a relative handful of laid-back activities each year. Troop C has families that can afford to pay for expensive trips, while Troop D is sensitive to families' financial challenges. Troop E is closely aligned with the church that sponsors it, while Troop F is proud of its multicultural makeup. Troop G is almost entirely Scout-led, while Troop H relies more on adults to guide its young members.
None of these troops is necessarily doing things wrong--unless what they're doing doesn't align with the priorities their families have. Such misalignment can led to struggles within the troop or exits from the troop by families that often don't realize the troop down the street might be a better fit.
What can you do about troop/family misalignment? A good first step is to use the Spirit of Adventure Council's nifty <a target="_blank" rel="noopener">"How Do You Scout" survey</a>.
Completing the survey is simple. First, for eight aspects of the Scouting experience, each family rates the current state of the unit and their own preference. Second, they mark whether misalignment in each area would be a big deal to them. Finally, they calculate a score that shows how aligned or misaligned they are with the unit.
The council recommends that all families in a unit complete the survey once a year and that someone collate the results. After that, it may be time for some hard conversations about whether the unit needs to change (if many families are misaligned) or whether the unit needs to help misaligned families find a new home in Scouting.
Breaking us is hard to do, of course. But it can be just as hard to stay together when you have nothing in common.
<hr />
NOW AVAILABLE: The fourth edition of <a target="_blank" rel="noopener noreferrer">The Eagle Court of Honor Book</a> is now available from <a target="_blank" rel="noopener">EagleBook.com</a> and on Amazon! Updated to reflect the inclusion of girls in Scouts BSA, the book features gender-neutral ceremonies, a new Scouting segment called "Scouting for Girls," and downloadable boys' and girls' versions of all ceremony materials. Print versions will be available soon from Amazon and <a target="_blank" rel="noopener">ScoutStuff.org</a&>></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>2171</wp:post_id>
<wp:post_date>2020-02-14 08:22:46</wp:post_date>
<wp:post_date_gmt>2020-02-14 13:22:46</wp:post_date_gmt>
<wp:post_modified>2020-02-14 08:22:46</wp:post_modified>
<wp:post_modified_gmt>2020-02-14 13:22:46</wp:post_modified_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>how-do-you-scout</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password/>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="scoutmastership"><![CDATA[Scoutmastership]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[4975509]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>geo_public</wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_publicize_job_id</wp:meta_key>
<wp:meta_value><![CDATA[40686201854]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>timeline_notification</wp:meta_key>
<wp:meta_value><![CDATA[1581686566]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_publicize_done_external</wp:meta_key>
<wp:meta_value><![CDATA[a:1:{s:7:"twitter";a:1:{i:6107962;s:56:"https://twitter.com/MarkRayKY/status/1228308610570170370";}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_publicize_done_6138549</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wpas_done_6107962</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>publicize_twitter_user</wp:meta_key>
<wp:meta_value><![CDATA[MarkRayKY]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>publicize_linkedin_url</wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_publicize_done_21543673</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wpas_done_22162702</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
</item>
</channel>
</rss>
- You must be logged in to reply to this topic.