How to Import Content From Socast
How to Import Featured Images and Attach Them to Your Articles in WordPress
So you’ve decided to self-host your content? We get it. And we’re here to make your transition as smooth as possible. One common question we get is:
"How do I import my featured images and attach them to my posts after export?"
Let’s walk through it.
What You’ll Get in Your Export
When you export your site (typically via WordPress WXR/XML), each post includes a meta field like:
<thumbnail_url><![CDATA[https://example.com/uploads/my-image.jpg]]></thumbnail_url>
This holds the featured image URL. But WordPress won’t automatically attach it when you re-import.
Option 1: Set Featured Images Automatically (for developers)
If you're a developer or have developer access, you can hook into the import process and let WordPress do the heavy lifting.
Here’s the code you (or your dev) can drop into your theme’s functions.php or a custom plugin:
add_action('import_post_meta', function($post_id, $key, $value) {
if ($key === '_thumbnail_url') {
$image_url = esc_url_raw($value);
$image_id = media_sideload_image($image_url, $post_id, null, 'id');
if (!is_wp_error($image_id)) {
set_post_thumbnail($post_id, $image_id);
}
}
}, 10, 3);
This will:
💡 Make sure allow_url_fopen is enabled on your server, and your import XML includes _thumbnail_url as a meta tag.
Option 2: Use WP All Import (no coding)
Not a developer? No worries — use the awesome WP All Import plugin.
Install WP All Import and upload your WXR file.
During the import setup:
Import _thumbnail_url as a Custom Field
Go to the Media tab.
Enable "Download images hosted elsewhere"
Map the _thumbnail_url value to the featured image.
That’s it! The plugin will handle the download and image attachment for you.
Final Notes
The official WordPress import tool doesn’t handle remote featured images, so one of the above methods is required.
Once set properly, your featured images will show up just like before!
Related Articles
How can I import historical website content? (Content Import)
SoCast provides historical content import for 1 file per website during onboarding and prior to website launch. For more information on historical content import contact your Client Success Onboarding Associate or SoCast Support at ...
Getting Started
Welcome to SoCast! This section will provide you with all the information you need to get started and prepare your website for launch. Setting up Your SoCast Account SoCast Client Preparation List How To Optimize Your Website For The Best User ...
Importing your Member / Listener Club Database
As part of setting up your website, SoCast will arrange to import your existing Member / Listener Club Database. Please coordinate this process with your designated SoCast contact. As they contain personal information, we ask that all files are ...
Setting up Your SoCast Account
Please follow the instructions below: A SoCast employee will create your personal account. Once created you will be sent an email from SoCast with your login credentials This email will come from: no-reply@socastsrm.com In the email from SoCast you ...
SoCast Client Preparation List
Name Description ACCOUNT SET-UP Account Names Full names of the radio stations, regions or networks Company Administrator Names and Emails of users responsible for administering accounts Network Admin Contact Name and email of first point of contact ...