Search documentation

Search documentation

Pages

Publishing

Review, publish, unpublish, and refresh delivered pages.

Publishing in plain language#

Saving and publishing are different actions.

  • Save draft records editor work for one language. Preview can show it; visitors cannot.
  • Publish validates the draft, creates a published version, and makes it available through normal delivery.
  • Unpublish removes that language's page content from public delivery while preserving draft and version history.
  • Archive removes a page from active editorial and preview work.
What visitors can see
Save draft   -> no public change
Preview      -> authorized editors review draft changes
Publish      -> delivery API returns the new version
Unpublish    -> delivery API no longer returns that language's page content

What happens when you publish#

Contoprix performs a real publication workflow:

  1. It locates draft page content for the selected language.
  2. It validates the draft for publishing.
  3. It copies draft content to the published version.
  4. It marks the page published.
  5. It creates a published version in history.
  6. It emits a page.published webhook event.

The delivery endpoint returns a page only when the request matches the website, language, public access settings, and published content.

Important

A page can be published in one language and unavailable in another. Review and publish every language your public site serves.

Safe publishing checklist#

Before publishing, preview the draft and check:

  1. The route is correct, including nested segments.
  2. The intended language is selected.
  3. Every block renders; no missing-component placeholder appears.
  4. Images have appropriate alternative text.
  5. Buttons have a label and safe URL.
  6. Linked entries and media are already publishable.
  7. Header, footer, breadcrumbs, and navigation are correct.
  8. Desktop and mobile layouts are usable.
  9. Page access matches its intended audience.

Then publish and open the normal public URL separately. It must use delivery data, not preview data.

Preview and delivery use different APIs#

PreviewPublic delivery
client.pages.getPreview(pageId)client.pages.get() or client.pages.getBySlug(path)
Page IDPublic route path
preview:readdelivery:read
Draft contentPublished content
Protected, no public cachingNormal application/CDN caching

A correct preview proves the draft is ready. It does not prove public delivery has updated.

Verify public delivery#

Server-side verification
import { getContoprixPage } from "@contoprix/next/server";

const page = await getContoprixPage({
  slug: "/about-us",
  languageCode: "en",
});

console.log(page.pageId, page.name, page.blocks.length);

A 404 normally means no published content matches that website, route, and language. Check publication first, then language code, access settings, delivery key, and public path.

Refresh frontend caches#

The CMS can publish correctly while your website still displays an old cached response. Use a short revalidation period, a signed webhook, or both.

app/api/contoprix/webhook/route.ts
import { handleContoprixWebhook } from "@contoprix/next/server";

export async function POST(request: Request) {
  return handleContoprixWebhook(request, {
    secret: process.env.CONTOPRIX_WEBHOOK_SECRET!,
  });
}

The handler verifies X-Contoprix-Signature with an HMAC. By default it revalidates page paths and Contoprix tags for page.published events. Configure the CMS webhook destination to use this endpoint and the same secret.

Never accept an unsigned “publish” request merely because it contains a page ID or slug.

Unpublish, restore, and schedule#

Unpublish#

Unpublishing affects the selected language. Drafts and history remain. If no language remains published, the page becomes unpublished.

Before unpublishing, update navigation links, plan redirects, invalidate caches, and confirm the public path now returns the expected 404 or redirect.

Restore#

Restoring a historical page-content version creates a useful draft. Preview the restored draft and publish it only after review; restoring does not bypass review.

Schedule#

Use scheduling for time-sensitive launches when available. Prepare validation and cache/webhook behavior before the scheduled time, then verify the live route afterwards.

Publishing problems#

What you seeMeaningAction
Publish validation failsA field, block, or relation is incomplete.Fix it, save, and publish again.
Preview is new but public page is oldDraft is unpublished or cache is stale.Publish, then trigger or await revalidation.
Delivery returns 404Page/language is not published or path is wrong.Check publication, locale, website, and route.
Delivery returns 403Page is not public or client scope is wrong.Review Access settings and delivery credentials.
Webhook is rejectedSecret or signature is wrong.Compare secrets and preserve raw request body.
Editorial workflow
Edit draft -> Preview -> Peer review -> Publish -> Verify public URL -> Confirm cache refresh

Keeping these steps separate prevents accidental releases and makes it easier to identify whether a problem belongs to the CMS draft, publication state, routing, or cache.