How to migrate your blog from HubSpot to WordPress

Table of Contents

Businesses rarely stick to the tools and platforms they used when they started their journey. Same is the case with CMS. You started with something but after a point of time that doesn't look like the perfect option for you. What to do? Thankfully you can migrate from one platform to another without any significant loss in your traffic and data. In this article we are talking about Hubspot and Wordpress. These are one of the most popular CMS out there in the market. And so, today we'll learn about the migration of blog from HubSpot to WordPress.

Depending on the size, page load speed, scope, and goals of your website you can migrate from HubSpot to WordPress. The pages of the old website can be easily added manually to the WordPress theme, but due to a large number of blogs, we can not put the content manually. So, we have come up with an out-of-box way to do this, which will make it very easy.

For this migration, we have used a Hubspot wordpress plugin known as LLM HubSpot Blog Import.

What will we Migrate

  • Title of the Blog.
  • Post Content (Body of the blog > Includes:- Image, CTA, Link, embed assets).
  • Featured Image.
  • Meta Description.
  • Publish Date & Time.
  • Tag - Categories.
  • Author.

The hubspot plugin, LLM HubSpot Blog Import is an automated service for the content management system. This online service allows migration of all the blog content from your HubSpot to Wordpress quickly, easily and for free. With this plugin, you can forget about those hours of manual data migration from HubSpot to wordpress.

How it works

  • You will need an HubSpot API for this, get it from the API key section of HubSpot.
  • After putting the API in the field, just press the 'Sync HubSpot Data' button.

Important Note: This Plugin migrates only 300 blogs at once.

Why it didn't work?

This works very well, but HubSpot allows only 300 blogs to be moved. If you have 300+ blogs, then you have to make changes to the plugin code. To do this, the content will have to be migrated by some time frame.

Solution

For this, we made some changes to the Wordpress php (.php) file. You can see the given below:

In your Wordpress dashboard, navigate to Plugins > Editor. Select LLM HubSpot Blog Import > save.php The code given below will need to be modified and replaced

.$response = wp_remote_get('https://api.hubapi.com/content/api/v2/blog-posts?hapikey='.$apiKey.'&archived=false', $getArgs);

In this code, we need to change "Epoch Timestamp", for which we will use online Epoch Timestamp converter. In this, we will take the time interval in which less than 300 blogs have been published. Instead of the old code, we have to replace this new code according to the timestamp. There will be the change in the highlighted from the colour.

.$response = wp_remote_get( 'https://api.hubapi.com/content/api/v2/blog-posts?hapikey=' . $apiKey . '&archived=false&created__range=1506816000000&created__range=1569888000000&state=PUBLISHED&limit=1000',$getArgs );

Side Effects

The side effect of doing this is that when we do this, the operation stops due to overloading of the server. To avoid this, the size of our server RAM should be re-configured depending upon the size of content.If you have any doubt, You can always reach out to Inbound Mantra (HubSpot Partner).

Want to know what happened when we migrated from Drupal to HubSpot?

Here is a bonus article for you.

The Drupal to HubSpot Migration

If you are migrating a blog from Drupal to HubSpot, so you are in the right place...

Before migration, let's first know its background...

There is no doubt that over 86,000+ companies in more than 120 countries prefer to use HubSpot tools to grow their business and increase the number of leads. But, some say that it is not for everyone because some people are unaware of the device and some are still surprised to learn- is this the right solution for them?

HubSpot- All in One Business Automation is the best tool to date as it provides free CRM services, but it is also true that with the increase in the number of contacts, organizations will have to spend a few bucks out of their own pocket.

It is easy to migrate blogs from HubSpot to any other CRM and from other CRM to HubSpot but we had a lot of problems to bring blog from Drupal to HubSpot. And there is no specific way to migrate the blogs from Drupal to HubSpot.

I know you might be thinking that using traditional approaches (COPY and PASTE), one can easily transfer blogs directly from Drupal to HubSpot. There is no doubt that it is easy, but chances are you may lose data and have to spend time transferring each blog individually as there are 350+ blogs here.

Now, you might be thinking about the right way to move a blog from Drupal to HubSpot. Scrolling down and reading this article will guide you with the proper steps, considering which you can move Drupal Blogs to HubSpot.

Before moving Drupal to HubSpot migration, have you ever thought about what you need? let's take a look. If not, then see below.

What do we need to migrate?

Below are some fields that we had to migrate from Drupal to HubSpot.

  1. Blog Title
  2. Featured image of respective blog you want to migrate
  3. Blog Content (data, images, links, CTA, embed assets)
  4. Meta Description
  5. Publish time and date
  6. Author
  7. Tags/Categories

Now, without taking a minute, let's dive into the following steps allowing you to transfer your blog posts directly from Drupal to HubSpot.

Blog Migration Steps From Drupal to HubSpot

Let’s get started….

Step 1: Export data from Drupal

First of all, we have to export the content from Drupal as an xml file. The Views Data Export module can do the heavy lifting for you. You can see here how it is created.

The biggest challenge was to convert the XML file generated by views data export to the Wordpress XML format supported by Hubspot.

Here are the fields that we need to migrate from Drupal to Hubspot:

  • Title
  • Featured image
  • Categories
  • Author
  • Body
  • Teaser (excerpt)
  • Published date

Step 2: Wordpress XML

The next step would be to create the WordpressXML from the XML generated from Drupal. We have used a simple Python script to do the conversion. The BeautifulSoup library can be used to parse the XML and do the conversion. 

In its simplest form, the wordpress XML looks like

<?xml version="1.0" encoding="UTF-8"?> <!-- Meta information --> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:wp="http://wordpress.org/export/1.2/" version="2.0"> <channel> <title>{title}</title> <link>{page_url}</link> <description>{page_description}</description> <pubDate>{time}</pubDate> <language>{lang}</language> <wp:wxr_version>1.2</wp:wxr_version> <wp:base_site_url>{page_url}</wp:base_site_url> <wp:base_blog_url>{page_url}</wp:base_blog_url> <!-- Authors, the same name should be used in the POSTs section --> <wp:author> <wp:author_login><![CDATA[{author1}]]></wp:author_login> <wp:author_display_name><![CDATA[{author1_name}]]></wp:author_display_name> </wp:author> <!-- Attachments: All featured images should come here as a separate item --> <generator>wp_feed_import.py</generator> <item> <title>{filename}</title> <link>{filename}</link> <pubDate>{date_rfc822}</pubDate> <dc:creator><![CDATA[{author}]]></dc:creator> <guid isPermaLink="false">{attachment_id}</guid> <wp:post_id>{post_id}</wp:post_id> <wp:post_date><![CDATA[{date}]]></wp:post_date> <wp:post_date_gmt><![CDATA[{date}]]></wp:post_date_gmt> <wp:post_name><![CDATA[{filename}]]></wp:post_name> <wp:status><![CDATA[inherit]]></wp:status> <wp:post_type><![CDATA[attachment]]></wp:post_type> <wp:attachment_url><![CDATA[{url}]]></wp:attachment_url> <wp:postmeta> <wp:meta_key><![CDATA[_wp_attached_file]]></wp:meta_key> <wp:meta_value><![CDATA[{filename}]]></wp:meta_value> </wp:postmeta> <wp:postmeta> <wp:meta_key><![CDATA[_wp_attachment_image_alt]]></wp:meta_key> <wp:meta_value><![CDATA[{filename}]]></wp:meta_value> </wp:postmeta> </item> <!-- All posts should come here --> <item> <title><![CDATA[{title}]]></title> <link>{link}</link> <pubDate>{date_rfc822}</pubDate> <dc:creator><![CDATA[{creator}]]></dc:creator> <guid isPermaLink="{guid_is_link}">{guid}</guid> <description /> <content:encoded><![CDATA[{content}]]></content:encoded> <excerpt:encoded><![CDATA[{excerpt}]]></excerpt:encoded> <wp:post_id>{post_id}</wp:post_id> <wp:post_date><![CDATA[{date}]]></wp:post_date> <wp:post_date_gmt><![CDATA[{date}]]></wp:post_date_gmt> <wp:post_name><![CDATA[{slug}]]></wp:post_name> <wp:status><![CDATA[publish]]></wp:status> <wp:post_type><![CDATA[post]]></wp:post_type> <!-- any number of categories can added with the category tag --> <category domain="category" nicename="{category_nicename1}"><![CDATA[{category_name1}]]></category> <wp:postmeta> <wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key> <!-- The attachment_id should match the id in the attachments section --> <wp:meta_value><![CDATA[{attachment_id}]]></wp:meta_value> </wp:postmeta> </item> </channel> </rss>


You need to fill the placeholders with actual value from the xml generated from Drupal. You can see an example here, which uses the rss feed xml as input. We are not using rss xml as it has some limitations on featured image, categories etc..

Step 3: Importing the WordpressXML to HubSpot

After you've exported your WordPress posts, sign in to your HubSpot account.

  • In your HubSpot account, click the settings icon settings in the main navigation bar.
  • In the sidebar menu, navigate to CMS > Blog.
  • In the upper right, click Import blog.
  • In the blog import dashboard, click Import new blog.
  • Select Import XML file to upload your XML file of WordPress posts.


Conclusion

To summarise everything, to do a Drupal to HubSpot migration, the steps involved:

  • Export data from Drupal
  • Convert it to WordpressXML
  • Import XML to Hubspot

Hope you can do this migration with the help of this article. You can contact us here for more information.

And If you would like to know more about my work on HubSpot COS, please look up the links below.

  1. The HubSpot Migration Checklist
  2. 5 Libraries A HubSpot COS Developer Should Use
  3. How to increase HubSpot COS Page Speed
hubspot to wordpress migration

Recent Posts

Mu Sigma logo

G2 Crowd | HubSpot Reviews

★★★★★ 4.6/5
5,997 reviews
Mu Sigma logo

capterra | HubSpot Reviews

★★★★★ 4.5/5
‎4,091 reviews