Content Versioning in Payload CMS: Turnkey Setup

Content Versioning in Payload CMS: Turnkey Setup

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    982
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    995

Content Versioning in Payload CMS: Turnkey Setup

Accidental article deletion or the need to roll back changes are common scenarios in content management. Hydration mismatch when previewing drafts and lack of change history are typical problems solved by content versioning in Payload CMS. Editor time savings reach 80%, and the risk of data loss is reduced by 99%. We set up versioning turnkey: drafts with autosave at 3-second intervals, live preview for React projects on Next.js, rollback in seconds. We'll evaluate your project and implement without downtime. Our experience with Payload CMS exceeds 5 years, and we have completed over 20 projects with versioning. The cost of fixing a manual error can reach 20,000 RUB, and with frequent edits, up to 50,000 RUB per month. Our setup brings these costs to zero.

Payload supports versioning out of the box, but without proper configuration, flexibility is lost. Versions are stored in a separate table _collectionname_versions. According to the official documentation, this isolation prevents conflicts during parallel editing. Let's break down the key features and implementation.

Unlike the standard configuration, custom setup allows managing version limits (up to 50 per document), storing deleted records, and enabling autosave. Without this, editors risk losing up to 10% of changes per day — our setup reduces the risk to zero.

What Problems Does Versioning Solve?

  • Data loss due to accidental deletion or editing. Autosave every 3 seconds prevents loss of up to 99% of changes.
  • No history for rollback. Without versioning, recovery takes hours; with Payload — seconds.
  • Difficulty collaborating on drafts. Multiple editors can edit their own copies without interference.
  • Inability to audit changes. Version logs show who, when, and what changed.

We guarantee that after setup you can roll back any publication with one click.

How We Configure Versioning

The process includes stages: audit current configuration → design schema → implement via collection configs → configure autosave and limits → integrate live preview → test rollback scenarios. Compared to manual copying, automatic versioning reduces recovery time by 10x. Compare: basic setup vs our custom setup.

Parameter Default Custom Setup
maxPerDoc 10 50 (adjustable per load)
retainDeleted false true (keep deleted)
autosave disabled 3s interval
draft control only publish/draft + review, pending statuses

Custom setup increases data storage reliability by 3 times compared to standard. And live preview integration speeds up content review by 2 times. Each version takes ~2–5 KB, so a limit of 50 versions adds only 250 KB per document — negligible for the database.

Step-by-Step Setup Guide

  1. Audit current configuration — check which collections need versioning and evaluate load.
  2. Design schema — determine limits (maxPerDoc), need for retainDeleted, and autosave parameters.
  3. Implement via config — add versions object to each collection and global.
  4. Configure autosave and limits — set interval to 3000 ms and limit to 50 versions.
  5. Integrate live preview — set preview URL for React projects.
  6. Test rollback scenarios — check version restoration and draft functionality.

How to Configure Live Preview with Next.js?

Setting up live preview in Payload 2.x with Next.js is a real case from our practice. Collection configuration:

// collections/Posts.ts const Posts: CollectionConfig = { slug: 'posts', versions: { maxPerDoc: 50, retainDeleted: true, drafts: { autosave: { interval: 3000 }, }, }, admin: { livePreview: { url: ({ data, locale }) => `${process.env.NEXT_PUBLIC_FRONTEND_URL}/posts/${data.slug}${locale ? `?locale=${locale.code}` : ''}`, }, }, fields: [ { name: 'title', type: 'text' }, { name: 'content', type: 'richText' }, ], } 

On the frontend, use draftMode to display drafts:

// app/(frontend)/posts/[slug]/page.tsx import { draftMode } from 'next/headers' import { getPayload } from 'payload' export default async function PostPage({ params }: { params: { slug: string } }) { const { isEnabled: isDraft } = draftMode() const payload = await getPayload({ config }) const result = await payload.find({ collection: 'posts', where: { slug: { equals: params.slug } }, draft: isDraft, overrideAccess: isDraft, }) return <PostComponent post={result.docs[0]} /> } 

Now editors see changes before publishing.

Why Custom Setup Is More Effective Than Standard?

The standard configuration limits versions (default 10) and does not store deleted records. Custom setup with a limit of 50 and retainDeleted: true provides a full change history, critical for projects with high edit frequency. Live preview integration reduces content review time by 2 times, and autosave prevents loss of up to 99% of data. As a result, editors save up to 80% of time, and administrators save up to 20% of recovery budget.

Common mistakes: not enabling retainDeleted, setting maxPerDoc too high, missing live preview. Our audit at the start identifies these and prevents data loss risks.

What's Included in the Work?

  • Versioning configuration for all collections and globals (up to 20 collections).
  • Autosave and limit setup.
  • Live preview integration with your frontend.
  • Access control for drafts.
  • Documentation on working with versions.
  • Editor training (comparison and restoration interface).
  • Post-launch support.

Estimated Timeline

Setup takes from 1 to 3 days depending on integration complexity. Cost is calculated individually. Contact us to evaluate your project. Get a consultation to protect your content.