I’m running into an issue with my website setup. I have my main site on WordPress but my landing pages are hosted on HubSpot under a subdomain.
The problem started when I was setting up Google Ads campaigns. When I use the HubSpot subdomain URLs directly in my ads, the subdomain shows up in the ad copy, which looks unprofessional. I want my main domain to appear instead.
To fix this, I set up 301 redirects from my WordPress domain to the HubSpot landing pages. The redirects work perfectly and users see my main domain in the ads. But now I have a new problem - all the UTM parameters from my ad campaigns are getting stripped out during the redirect process.
This means I can’t track which ads are driving traffic or measure campaign performance properly. Has anyone dealt with this before? What would be the best way to preserve the UTM codes when redirecting from WordPress to HubSpot?
This redirect setup breaks because WordPress and HubSpot handle URL parameters differently. I’ve seen this exact issue when moving campaign pages between platforms. The problem isn’t just your redirect config - it’s how HubSpot processes URLs with parameters. HubSpot’s tracking script often conflicts with UTMs from external redirects. Try using HubSpot’s URL builder to create tracking URLs that match your campaigns, then redirect to those pre-built HubSpot URLs instead. Or add JavaScript to your WordPress redirect pages that grabs UTM parameters and tacks them onto the destination URL before the redirect fires. This gives you way more control than relying on server config alone. Test everything with Google’s Campaign URL Builder before you start burning ad budget.
wp redirects can be a pain, man. Try using the “Redirect Redirection” plugin and just check the box for preserving params. Or an easy hack is to add a ? to the end of your dest URL in the redirect rule. It kinda forces wp to keep whatever was after. Usually works!
Been there. UTM parameters getting stripped on redirects is annoying as hell when you’re tracking ad performance.
WordPress redirect plugins suck at handling query parameters. You could configure redirects to preserve UTM codes, but it gets messy with multiple campaigns.
Better approach - automate UTM tracking. Capture the parameters before redirect, send data straight to your analytics or CRM.
I use Latenode for this stuff. Build a workflow that grabs the original URL with UTMs, logs them to a database or Google Sheets, triggers the redirect, and pushes campaign data to HubSpot or GA.
You keep clean URLs in ads, redirects work properly, and don’t lose any tracking data. Plus better reporting since everything runs through one system.
Manual fixes always break eventually. WordPress redirects are flaky, and HubSpot’s URL processing makes it worse.
Forget htaccess rules and unreliable plugins - automate your tracking pipeline instead. Capture everything when someone clicks your ad, before any redirect happens.
I built a system with Latenode that intercepts the initial click, logs all UTM data to our analytics stack, then redirects users to the HubSpot page. Parameters can’t get lost because they’re already stored.
Bonus: you can enrich tracking data, merge it with other campaign metrics, and push clean attribution back to HubSpot or Google Analytics. Way more reliable than hoping URL parameters survive redirects.
The automation handles edge cases too - bookmarked redirected URLs, shared links without parameters. Your tracking stays consistent.
You’re experiencing issues with UTM parameters being stripped when redirecting from WordPress to HubSpot landing pages using 301 redirects. This prevents accurate tracking of ad campaign performance. Your redirects work correctly in terms of showing the main domain, but the query parameters (UTMs) are lost in the process.
Understanding the “Why” (The Root Cause):
WordPress’s default redirect mechanisms, and even many plugins, often don’t properly handle query strings (the part of a URL after the ?). A standard 301 redirect typically focuses only on the path component of the URL. When you use .htaccess redirects or plugins without explicitly preserving query strings, the UTM parameters are dropped during the redirection process because the redirect rule isn’t configured to include them. HubSpot’s own URL processing might also contribute, as it may interpret the incoming URL differently, particularly if the redirect isn’t handled explicitly.
Step-by-Step Guide:
Modify your .htaccess file: This is the most direct and reliable method. Instead of relying on plugins, directly modify your WordPress site’s .htaccess file to include the QSA (Query String Append) flag in your redirect rule. This flag tells Apache to append the query string from the original URL to the redirect target. Assume you have a redirect rule like this (replace with your actual paths):
This ensures that any query parameters (including UTMs) are preserved during the redirect. Important: Always back up your .htaccess file before making any changes. Incorrectly formatted rules can break your website.
Verify the Redirect: After making changes to your .htaccess file, thoroughly test your redirects. Use a tool like Google’s Campaign URL Builder to create test URLs with various UTM parameters. Access these URLs through your WordPress redirect and use your browser’s developer tools (Network tab) to examine the HTTP headers of the redirect response. You should see the UTM parameters in the final HubSpot URL’s query string.
Check your WordPress Redirect Plugin (if applicable): If you’re using a plugin instead of .htaccess for redirects (like the “Redirection” plugin), ensure that you have explicitly enabled the option to “pass query parameters” or a similar setting within the plugin’s configuration for the specific redirect rule. Many plugins have this setting overlooked by default, causing the UTM issue.
Common Pitfalls & What to Check Next:
Multiple Redirects: If you have chained redirects (a redirect from one WordPress page to another, then to HubSpot), ensure that all redirects in the chain preserve query parameters using the QSA flag or equivalent plugin settings. Otherwise, UTMs could be dropped at any stage.
HubSpot Tracking Conflicts: In some cases, HubSpot’s own internal tracking script might interfere with external UTM parameters. If you continue to have problems after correctly implementing the above steps, investigate HubSpot’s tracking settings to ensure they don’t conflict.
Incorrect Regex: Make absolutely sure your rewrite rule RewriteRule ^landing-page$ ... correctly matches the URL pattern you need to redirect. If it is mismatched it can prevent proper handling. Use a regular expression tester to ensure your rule is matching accurately.
Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!