For a B2B software company, the website sits between the product and the CRM: it is where strangers become leads, leads become trials and trials become revenue. The architecture that serves that job well has three properties. Marketers can publish without filing an engineering ticket, everything lives on one domain, and attribution captured on the first visit survives all the way to the CRM. Headless WordPress is one practical way to get all three. This guide explains how, and when it is more than you need.

The problem with most SaaS marketing stacks

Most SaaS companies end up with a marketing stack that nobody designed. It grew one decision at a time, and now it looks something like this.

The product lives on app.company.com, built in React or Next.js. The marketing site is on company.com, built in Webflow or Squarespace because the marketing team needed to ship landing pages without waiting for engineering. The blog is on blog.company.com, running on Ghost or a basic WordPress install. The docs are on docs.company.com. A Notion page linked from the footer serves as the changelog.

That is four or five systems with separate deploys, no shared component library, no shared analytics context and no single content strategy. Here is what breaks.

The content team can’t change the marketing site without an engineer, because the site builder’s limits surface the moment you need conditional logic, dynamic filtering or a custom integration. Every landing page request goes into the sprint backlog and ships weeks late.

Search signals are scattered. Links earned by blog.company.com point at a different host from the pricing page, demo form and product pages that actually sell. Internal linking, analytics and Search Console are split the same way.

Brand consistency drifts. The product uses your design system. The marketing site uses the site builder’s approximation of it. The blog uses a theme that was “close enough” a year ago. Every touchpoint looks slightly different, and sophisticated buyers notice the lack of coherence.

Headless WordPress addresses this by consolidating the content layer into one platform that both marketers and developers can work with, rather than adding yet another system.

What headless WordPress actually means

Headless WordPress separates content management from rendering. WordPress does what it is good at: content creation, editorial workflows, revision history, user roles and an ecosystem of SEO and integration plugins. A separate front-end framework does what WordPress is weaker at: rendering fast, modern, component-based pages.

In practice, WordPress runs on an internal URL (cms.company.com, or a private server) that only the content team uses. They write and publish in the block editor, the interface many of them already know. A front-end framework such as Astro or Next.js fetches that content through the WordPress REST API or WPGraphQL. The front end compiles it to static HTML, or server-renders pages that need dynamic content, and deploys to company.com through your normal CI/CD pipeline.

The content team publishes in WordPress, a build triggers automatically, and the site updates on company.com within minutes. No engineer is in the loop for content changes, and engineering keeps full control of the front-end architecture, component library and performance. Our headless CMS page covers how we scope this kind of build.

Why not Contentful, Sanity or Notion?

Fair question. The headless CMS market has more options than anyone needs, and several of them are excellent. Here is where WordPress wins and where it doesn’t.

Editorial experience for non-technical users. The block editor is familiar to a large pool of marketers, and a new hire can usually publish a formatted post with images and embeds on day one. Contentful’s interface is powerful but takes more getting used to. Sanity Studio has to be configured before anyone can use it. Notion is pleasant for internal docs but wasn’t designed as a publishing CMS: SEO fields, editorial workflow and scheduling are not what it is built for.

Plugin ecosystem for marketing operations. Yoast or Rank Math for SEO metadata, ACF or Meta Box for custom fields that map cleanly to front-end components, and a long tail of integrations built up over many years. One caveat: in a headless build, plugins that render things on the page (form builders, sliders, page builders) don’t carry over to the front end. The value is on the editorial and data side.

Cost. WordPress is open source, and managed WordPress hosting is a predictable monthly line. Hosted headless platforms typically price by seats, content volume or API usage, so check how their tiers scale against your plans for landing pages and traffic before you commit.

Data portability. Your WordPress content lives in a standard MySQL database that you control: you can export it, query it and move it. Hosted platforms such as Contentful, Sanity and Storyblok keep content in their own data models behind their APIs. They offer exports, but leaving still means remapping content to a new model.

Where WordPress loses: real-time collaborative editing (Google Docs and Notion are better for drafting together), developer experience on the API layer (Sanity’s GROQ is more expressive than the WordPress REST API or WPGraphQL for complex content relationships), and setup effort (a headless WordPress build takes more upfront configuration than signing up for a hosted CMS). These are real trade-offs. If your team lives in Notion and your developers want a CMS designed API-first, Sanity may be the better call. If your priority is a content workflow that marketing can own without engineering support, WordPress is still the pragmatic choice. We compare the options in more depth in headless CMS vs WordPress.

Subdomain or subdirectory?

Sites rank with either blog.company.com or company.com/blog, so a subdomain won’t sink you on its own. The practical case for the subdirectory is simpler: one host, one Search Console property, one analytics context, one set of internal links, and every link the blog earns points at the same site as the pages that sell. It is also one less system to maintain.

The headless architecture makes the subdirectory easy. WordPress runs on a private URL. The front-end framework fetches blog content through the API and renders it at company.com/blog, alongside company.com/pricing and the landing pages. To visitors and to search engines it is one site.

This is a routing decision in the front-end framework, not a WordPress setting. In Astro, for example, you would create a src/pages/blog/[slug].astro route that fetches the matching WordPress post at build time. The WordPress installation’s URL never appears on the public site. If the blog already lives on a subdomain, moving it is a small site migration: map every URL and 301-redirect it to its new path.

The lead capture architecture

The point of a SaaS marketing site is turning visitors into pipeline. Here is a lead capture setup built on the headless stack.

Top of funnel

Blog posts targeting problem-aware searches: people who don’t know your product exists but are looking for a way to solve the problem it solves. Those posts have the best chance of ranking on a fast, technically sound site with proper SEO foundations.

Middle of funnel

Gated content (guides, templates, benchmark reports) delivered through a form. The form is built in the front-end framework rather than a WordPress form plugin, since the front end is decoupled, and it submits to your marketing automation platform (HubSpot, ActiveCampaign, Mailchimp) by API or webhook. WordPress manages the gated asset; the front end handles the gate.

Bottom of funnel

Demo request forms and pricing pages fire conversion events to Google Tag Manager, which passes them to your CRM. Each event carries attribution data: the channel, campaign and content that brought the visitor.

UTM persistence: the technical pattern

Attribution breaks when UTM parameters are lost between the landing page and the conversion page. A visitor clicks a LinkedIn ad with ?utm_source=linkedin&utm_medium=paid&utm_campaign=q1-launch, reads a blog post, navigates to the pricing page, and submits a demo request. By the time they submit, the UTM parameters are gone from the URL.

The fix is to capture UTMs on arrival and persist them through the session:

// Capture UTMs on any page load
function captureUTMs() {
  const params = new URLSearchParams(window.location.search);
  const utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];

  utmKeys.forEach(key => {
    const value = params.get(key);
    if (value) {
      sessionStorage.setItem(key, value);
    }
  });
}

// Inject UTMs into any form as hidden fields
function injectUTMs(form) {
  const utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];

  utmKeys.forEach(key => {
    const value = sessionStorage.getItem(key);
    // Skip keys the form already carries, so a resubmit doesn't duplicate them
    if (value && !form.elements.namedItem(key)) {
      const input = document.createElement('input');
      input.type = 'hidden';
      input.name = key;
      input.value = value;
      form.appendChild(input);
    }
  });
}

// Run on page load
captureUTMs();

// Run before any form submission
document.querySelectorAll('form').forEach(form => {
  form.addEventListener('submit', () => injectUTMs(form));
});

This stores UTMs in sessionStorage, which persists across page navigations in the same tab and clears when the tab closes, and injects them as hidden fields into every form submission. Your CRM receives the attribution data alongside the lead, so each demo request can be traced back to the campaign behind it. Two limits to know: a new UTM-tagged visit in the same tab overwrites the earlier values (last touch wins), and a visitor who comes back days later in a new tab arrives without them. If you need first-touch attribution across visits, store the first values in a first-party cookie and record that in your privacy notice.

Fire the same data to GTM on form submission for redundancy:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'form_submission',
  form_id: 'demo_request',
  utm_source: sessionStorage.getItem('utm_source'),
  utm_medium: sessionStorage.getItem('utm_medium'),
  utm_campaign: sessionStorage.getItem('utm_campaign')
});

The pattern is simple and often missing. Teams tend to find out months into a paid campaign, when the CRM shows a large share of demo requests arriving from “direct.”

When this architecture is overkill

If you’re a small team still looking for product-market fit, don’t build this. Use Webflow or Framer for the marketing site, publish blog posts on your main domain with whatever tool is fastest, and leave headless WordPress and attribution plumbing until you have something worth marketing at scale.

This infrastructure makes sense when three things are true:

  1. You have a content team. At least two people whose job is producing and distributing marketing content. One person wearing the content hat part-time doesn’t justify the overhead.
  2. You have a committed marketing budget. The stack has running costs (hosting, tools, maintenance) before you spend anything on content, and it only pays back if you keep publishing.
  3. You’re playing a long game. Content-led growth compounds, but it usually takes many months before organic search carries real weight. If you need leads next month, run paid campaigns on a simple site and revisit this architecture when the economics support it.

Three questions before choosing your marketing stack

Can your marketing team publish without filing an engineering ticket? If not, the stack is wrong however elegant it is. The best architecture takes engineering out of day-to-day content work entirely.

Is your blog on the same domain as your product marketing pages? If it sits on a subdomain, decide whether to consolidate now. The longer you wait, the more URLs the eventual migration has to redirect.

Can you trace a closed deal back to the blog post that brought the first visit? If your attribution chain is broken, the UTM persistence pattern above is the minimum fix, and a first-touch cookie closes most of the remaining gap. Without them, you’re making content investment decisions blind.

If your stack fails any of these tests, fix the first one first: a team that can’t publish can’t benefit from the other two.