Production

Your CMS preview should match your published output

The preview that lies

Most CMS platforms ship a preview function that shows some version of your draft. Half the time it's a stripped-down view that ignores your actual templates. The other half it applies different CSS, skips dynamic elements, or silently fails when a required field is empty.

You write a post, click preview, see something plausible, and publish. Then you check the live page and the layout's broken, the sidebar disappeared, or the image you uploaded sits at 4000 pixels wide because the production template runs a responsive wrapper your preview skipped.

Every mismatch trains your team to distrust the tool. They start checking live after every publish, or worse—they stop checking at all.

Make preview use the real template

Your preview should render the exact template your publish action will use. Same HTML structure, same CSS files, same image processing pipeline, same conditional logic. The only difference should be authentication: you're logged in, so you can see it.

If your live pages pull in related posts, your preview should too. If your production template hides the author bio when the field is empty, preview needs to do the same. If your image file names get rewritten on upload, preview should show the rewritten version.

This isn't exotic. It's a single rendering path with a query parameter that checks draft status instead of publish status.

Test preview with incomplete drafts

The place preview fails hardest is halfway through a draft. You've filled the title and body but skipped the excerpt. You uploaded a featured image but haven't set alt text. You selected two tags but the template expects three for the related content widget to fire.

Your preview should show exactly what would happen if you published right now—including the gaps. A missing excerpt should render as missing, not as a placeholder that says "Excerpt goes here." An empty tag list should break the related posts module the same way it would on the live site.

That's when you learn your content-ready checklist is incomplete, or that your template fails loudly instead of degrading gracefully.

Preview should respect your publishing schedule

If you schedule a post for next Tuesday and your live site runs a "recent posts" widget, preview should show what that widget will look like on Tuesday. Not what it looks like now with the draft included, and not what it looks like with the draft excluded.

Scheduled publish creates a time-travel problem. Preview has to render the future state of your content, which means either your preview logic tracks effective dates or you're pretending the schedule doesn't affect layout.

Most platforms pretend.

When preview and publish diverge, fix the template

If your preview can't match production because your production template does something fragile—fetching live API data, running server-side personalization, injecting ads—your template is the problem, not your preview.

Split your template into the parts that belong in every render and the parts that only make sense on the live domain. Authentication-gated content, A/B tests, and third-party embed scripts can wait until publish. Everything else should be identical.

The goal is simple: if it looks right in preview, it will look right when you ship it. Anything less turns publishing into a gamble.

← All posts