APIs & Integrations

Liam39steps
Teilnehmer/-in

Migrating WordPress to HubSpot with Featured Images

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.

0 Upvotes
14 Antworten
cbarley
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Migrating WordPress to HubSpot with Featured Images

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. 

Sameer
Teilnehmer/-in | Platinum Partner
Teilnehmer/-in | Platinum Partner

Migrating WordPress to HubSpot with Featured Images

Hi @cbarley 

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

 

Thanks,

-Sameer

IsaacTakushi
HubSpot Employee
HubSpot Employee

Migrating WordPress to HubSpot with Featured Images

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

Associate Certification Manager
TereB-n-O
Teilnehmer/-in | Diamond Partner
Teilnehmer/-in | Diamond Partner

Migrating WordPress to HubSpot with Featured Images

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

cbarley10
Mitwirkender/Mitwirkende

Migrating WordPress to HubSpot with Featured Images

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.

TereB-n-O
Teilnehmer/-in | Diamond Partner
Teilnehmer/-in | Diamond Partner

Migrating WordPress to HubSpot with Featured Images

Thank you @cbarley10 Smiley (fröhlich)

IsaacTakushi
HubSpot Employee
HubSpot Employee

Migrating WordPress to HubSpot with Featured Images

Thanks for tagging us, @cbarley10 Smiley (zwinkernd)

 

@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

Associate Certification Manager
TereB-n-O
Teilnehmer/-in | Diamond Partner
Teilnehmer/-in | Diamond Partner

Migrating WordPress to HubSpot with Featured Images

Hi Isaac

 

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

Warm regards,

Tere

IsaacTakushi
HubSpot Employee
HubSpot Employee

Migrating WordPress to HubSpot with Featured Images

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

Associate Certification Manager
KMC
Mitglied

Migrating WordPress to HubSpot with Featured Images

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

jmahan
Teilnehmer/-in

Migrating WordPress to HubSpot with Featured Images

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?

0 Upvotes
Liam39steps
Teilnehmer/-in

Migrating WordPress to HubSpot with Featured Images

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.

0 Upvotes
allijorgensen
Mitglied

Migrating WordPress to HubSpot with Featured Images

Hi Liam, 

 

I know it's been a while since you've posted, but I am having the exact same difficulty and was wondering if you could explain to me how you adjusted the Wordpress export to include featured image? 

 

Thanks!

0 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Migrating WordPress to HubSpot with Featured Images

hey @allijorgensen ,

I would highly recommend checking out this post

HubSpot is rolling out a new way to import a blog called "Smart Copy".  That post I linked will give you all the details you need 🙂