How to Remove HubSpot CTA Button Strings in HubSpot to WordPress Migration

  • read

Pasted into

When migrating a HubSpot blog to WordPress or another CMS you will often find text strings in your articles that look like this {{cta('4cdfhg-a57e-dfh-dfh-5c6dfhgdfhdfgc','justifycenter')}}

Most likely you are going to replace those with a new button pointing to a landing page but that takes time to update. Also doing a database find and replace would work but that can also be risky because you are not 100% sure what and where things are being changed.

A safer option would be to use javascript to hide the text string on the frontend. This will also help later on when the site is indexed in Google because you can search your site for that string and manually update the posts when you have the time.

Below is some code to help you find all HubSpot CTA strings in your blog posts. Add this to a javascript file loaded in your site.

View codepen demo

New Industrial HubSpot Theme Released

Do you use HubSpot just for a blog or landing pages? No problem. this HubSpot theme contains the most common types of landing pages and a robust blog template to get you started. Learn More

Written by: Jacob Lett - Jacob is a marketing and web design consultant who helps manufacturers grow their revenue. Unlike his competitors, he focuses on small and consistent website design changes to increase results. He recently created the Industrial HubSpot Theme to help manufacturers quickly build their website on the HubSpot platform.
Category: Code Snippets
Tags: , ,

Want to Get Email Updates?

Receive a monthly digest of new tutorials and resources.