Migrating WordPress to HubSpot with Featured Images

Highlighted
New Contributor

Not sure if this is the right place to ask, but here goes. I'm migrating our WordPress blog over to HubSpot, using the WordPress export function. It has come to my attention that none of the feature images have come across.

 

Looking at the XML document that's exported from WordPress, there are no references to feature images. I was wondering if anybody else here has had the same issue.

 

Now, I see that there's a plugin which exports the media file information for each featured image — although separately (at the top of the XML document) from the post dat further down. It looks like I'm going to have to manipulate the XML to get all the data in the correct place (and within <img> tags) so that HubSpot can pull it in.

 

If there's something I've missed, please let me know. AFAIK, I've followed the correct migration proceedure.

Reply
0 Upvotes
12 Replies 12
Highlighted
HubSpot Moderator

Hi @Liam39steps , I believe this is an issue with how Wordpress generates their XML files, If you send me your HubID I can take a look at the XML file itself. Normally the issue is that the wordpress blogs will have featured images with relative URLs rather than absolute URLs. Can you send me your HubID?

 

The <wp:attachment_url> image reference needs to be absolute, rather than relative. 

Highlighted
New Contributor

Connor, sorry for the late response. I managed to adjust the export function in Wordpress to include the featured image. I've now successfully imported posts with featured image intact.

Reply
0 Upvotes
Highlighted
Occasional Contributor

I'm having this issue as well. Can I send my HubSpot ID to you so that you can take a look at our XML file?

Reply
0 Upvotes
Highlighted
New Contributor

I'm currently experiencing this issue, but don't have access to the old wordpress site. Would you mind taking a look? 

Highlighted
Occasional Contributor | Diamond Partner

Hello!

 

I saw your answer for a user who was having trouble migrating a WordPress blog to HubSpot with featured images.  I saw you ask the user if he/she could send you the xml file in order to help them. I am having the exact same problem, actually I already opened two support tickets but I haven't been able to migrate the WP blog to HubSpot correctly.

 

Would you kindly help me?

 

Best regards,

Tere

Highlighted
Regular Contributor

Hey @TereB-n-O , I don't work at HubSpot any longer, but it might be possible for @WendyGoh@IsaacTakushi or @lscanlan to help you out here. The general issue that we see is that Wordpress will generate the XML file using relative paths (so for example, a link will only have the path in it, i.e. /home or /about), but HS needs absolute paths, since the links that are in the XML file are relative to the Wordpress domain and need something to reference. If you spot check the XML file for any reference of URLs that are relative, and not absolute, then you'll likely need to find a way to export the absolute URLs via Wordpress in order to fix the issue.

Highlighted
Occasional Contributor | Diamond Partner

Thank you @cbarley10 Smiley Happy

Highlighted
HubSpot Moderator

Thanks for tagging us, @cbarley10 Smiley Wink

 

@TereB-n-O, I see you direct messaged me. Could you share your Hub ID and the IDs of the support tickets you've opened so I can catch up on what you've already tried?

Also, I assume you've already referenced this article?

Isaac Takushi

HubSpot Developer Support
Highlighted
Occasional Contributor | Diamond Partner

Hi Isaac

 

Thank you for your reply. I've sent the Ids via direct message. 

Warm regards,

Tere

Highlighted
HubSpot Moderator

Hey, @TereB-n-O.

 

Thank you for sharing that information! I found the support ticket you have open with my colleague Samantha.


The issue actually wasn't related to absolute or relative file URLs.

 

Instead, your blog post template lacked the HubL code necessary to render featured images. Your blog listing template had the code, however, which is why the images appeared there.

 

I have added the following HubL code to your blog post template and featured images now appear.

 

{% if content.post_list_summary_featured_image %}
        <div class="hs-featured-image-wrapper">
            <a href="{{content.absolute_url}}" title="" class="hs-featured-image-link">
                <img src="{{ content.post_list_summary_featured_image }}" alt="{{ content.featured_image_alt_text }}" class="hs-featured-image">
            </a>
        </div>
{% endif %}

 

Samantha will also be following up in your support ticket.

Isaac Takushi

HubSpot Developer Support
Highlighted
Occasional Contributor | Platinum Partner

Hi @cbarley 

Do we have a known solution to this issue? Can you share the details and the code if possible.

 

Thanks,

-Sameer

Highlighted
HubSpot Moderator

Hi, @Sameer.

 

Per this comment@cbarley no longer works at HubSpot; his new user is @cbarley10. That said, I'm happy to help.

 

The solution to the original poster's question necessitates action in the WordPress export tool and is summarized in this HubSpot article:

 

Before importing your blog, review all internal links and images to confirm they include the absolute URL instead of a relative URL. This will prevent links and images from breaking in your imported posts.

Beyond this WordPress documentation, I'm not certain exactly which setting or toggle the original poster adjusted to include the featured image. Perhaps you could clarify, @Liam39steps?

Isaac Takushi

HubSpot Developer Support