How Do I Import Featured Images and Attach Them to Articles in WordPress After Exporting From SoCast?

How Do I Import Featured Images and Attach Them to Articles in WordPress After Exporting From SoCast?

How Do I Import Featured Images and Attach Them to Articles in WordPress After Exporting From SoCast?

If you are moving your content from SoCast to a self-hosted WordPress site, you may want to ensure your featured images are properly imported and attached to your articles. Here’s how you can do it, step by step.

What Is Included in Your Export?

When you export your site (typically via a WordPress WXR/XML file), each post includes a meta field like this:

<thumbnail_url><![CDATA[https://example.com/uploads/my-image.jpg]]></thumbnail_url>

This field contains the featured image URL. However, WordPress will not automatically attach this image as the featured image when you import your content.

Option 1: Set Featured Images Automatically (For Developers)

If you have access to a developer, you can automate the process by adding a code snippet to your theme’s functions.php file or a custom plugin. Here’s an example:

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 code will:

  • Automatically download the image from the _thumbnail_url field
  • Attach it to the post
  • Assign it as the featured image

Note: 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 Required)

If you are not a developer, you can use the WP All Import plugin to handle this process easily.

  1. Install WP All Import and upload your WXR file.
  2. 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 download and attach the images for you.

Final Notes

  • The official WordPress import tool does not handle remote featured images, so you must use one of the methods above.
  • Once set up, your featured images will appear with your posts just as before.
    • Related Articles

    • How Can I Import Historical Website Content into SoCast? (Content Import)

      How Can I Import Historical Website Content into SoCast? (Content Import) SoCast offers a historical content import service for one file per website during onboarding and prior to your website launch. For more information about importing historical ...
    • How Do I Add a Clickable PDF Link to a Page in SoCast?

      How Do I Add a Clickable PDF Link to a Page in SoCast? Who Is This Article For? All users with access to Pages Applicable to all themes Follow these instructions to add a clickable PDF link to a page, blog post, or other content area in SoCast. ...
    • What Are the Quick Links for SoCast Theme 3.0 Support Articles?

      What Are the Quick Links for SoCast Theme 3.0 Support Articles? Below is a curated list of support articles to help you manage and customize your website using SoCast Theme 3.0. These resources cover social links, hero images, advertising, theme ...
    • How Do I Create a Comments Blacklist in SoCast?

      How Do I Create a Comments Blacklist in SoCast? Who Is This Article For? All users with the Manage Comments permission Applicable to: All Themes Important Note The comments section blacklist works differently from the Activity Stream blacklist. You ...
    • What Should I Know About SoCast Premium Content Feeds?

      What Should I Know About SoCast Premium Content Feeds? SoCast Premium RSS Feeds are available as an add-on and can be purchased per brand or station. For more information, please contact SoCast Support or your SoCast Sales Representative. SoCast’s ...