Skip to content
TurnIntoCMS

How to let clients edit a Next.js site without a CMS

By Yash Garg · · 6 min read

You can let a client edit a Next.js site without adding a CMS by keeping the content in your repository and giving the client a safe way to change it: a data file they edit on GitHub, a Git-based CMS that writes files for them, or a visual editor that commits straight into your JSX. All three keep the code as the source of truth, and each push redeploys the site through your host's Git integration. Which one fits depends on how often the client edits and how comfortable they are with GitHub.

This guide covers the options, a setup checklist that works for all of them and the mistakes that cause broken builds after handoff.

Why skip a headless CMS at all

A headless CMS moves content out of your code into a hosted database and an API. That is the right call for a site that publishes every day, has several editors and needs scheduled posts. For a five-page marketing site where the client changes a price twice a month, it adds a second system to pay for, a content model to maintain and API calls in every page.

Keeping content in the repository has three practical benefits:

  • One history. Every content change is a commit next to code changes, so you can see who changed what and when.
  • One deploy path. The site rebuilds from Git the same way it does today. Vercel, for example, lists preview deployments for every push as a benefit of its Git integration.
  • One undo. A bad edit is reverted like any other commit.

The cost is that content has to live somewhere the client can reach without breaking code. That is what the rest of this guide sets up.

Step 1: move editable copy into data files

Clients break builds when they edit inside JSX. A stray quote or a deleted closing tag stops the deploy. The fix is to pull the text a client will touch into plain data files that pages import.

Next.js is unopinionated about how you organize project files, so pick one convention and keep it. For example:

FileWhat lives thereWho edits it
content/home.tsHero headline, subtitle, call to action textClient
content/pricing.tsPlan names, prices, feature listsClient
content/team.tsNames, roles, photo pathsClient
app/page.tsxLayout and componentsYou

Export plain objects and arrays with string values. Keep logic, class names and imports out of these files. A client who opens content/pricing.ts should see words and numbers, nothing that looks like code they could damage.

Step 2: choose how the client makes changes

There are four realistic ways to let the client edit those files. They differ in setup time and in how much Git the client has to see.

Option A: GitHub's web editor

The client gets collaborator access and edits the data file in the browser. GitHub says you can edit files directly on GitHub with its file editor, then commit or propose the change.

Good fit: a technical client, rare edits. Weak spot: the client edits raw TypeScript and sees your whole repository.

Option B: a Git-based CMS

A Git-based CMS gives the client a form-based editor and writes the result back to your repository. Decap CMS describes itself as an open source CMS for your Git workflow where content is stored in your Git repository alongside your code. TinaCMS is similar: when a user saves a change, a commit is made back to your Git repository. We compare both against editing in place on the TurnIntoCMS vs TinaCMS and Decap CMS comparison pages.

Good fit: blogs and collections of similar entries. Weak spot: you define a content model for every field the client may edit, and your pages usually need to read content in the shape the CMS expects, often Markdown or JSON.

Option C: a visual editor over your source code

A visual editor shows the live page, lets the client click text or a picture, and writes the change back into the source file as a commit. TurnIntoCMS works this way for Next.js and React sites: it reads a page and the data files it imports, and each publish becomes one commit on the branch you choose. Its limit is that content must be in the code; text fetched at runtime from an API isn't editable.

Good fit: marketing sites where the client wants to see the change in place. Weak spot: it changes existing content and list items, not page layouts. The tool comparison lays out these options side by side.

Option D: you make the edits

Some clients prefer to email changes. That is fine for a handful a year. It stops scaling when every price change waits on your calendar.

Step 3: protect the branch that deploys

Whatever option you pick, protect the branch your host deploys to production. GitHub notes that by default a branch protection rule disables force pushes and prevents the branch from being deleted. That alone stops the most damaging accidents.

Be aware of one interaction: GitHub's own file editor can't write to a protected branch, so with Option A the client edits on a separate branch and you merge. With a tool that commits for the client, point it at a branch you are happy to deploy from, or at a staging branch with its own preview URL.

Step 4: decide how a mistake gets undone

Agree on the undo path before the first edit, not after the first broken page:

  1. Every client edit is its own commit with a clear message.
  2. A wrong edit is undone with a revert, which records a new commit that reverses the earlier one, as the git revert documentation describes.
  3. If the live site is broken right now, roll back in your host first, then revert in Git so the next deploy doesn't bring the problem back.

Handoff checklist

Copy this into your project notes:

  • Editable copy lives in data files, not inside JSX
  • Data files contain only strings, numbers and arrays
  • The client's editing method is chosen and tested with one real change
  • The production branch is protected against force pushes and deletion
  • Each push builds a preview the client can check
  • The client knows how to report a mistake and you know how to revert it
  • Images have a fixed folder and a size guideline

Common mistakes and their fixes

  • Copy scattered across components. The client can't find the sentence they want to change. Fix: one data file per page or section.
  • Logic inside content files. A client edits a function by accident. Fix: content files export plain values only.
  • Edits straight to an unprotected main branch. One bad commit takes the site down with no review. Fix: protect the branch and use previews.
  • Huge uploaded images. Page weight jumps after the client swaps a hero photo. Fix: agree on a maximum size and compress on upload.
  • No undo plan. Fix: write down the revert steps at handoff.

For a walkthrough of the visual option, see letting clients edit a Next.js site, or create an account and connect a test repository first.

FAQ

Can a client edit a Next.js site without knowing Git?

Yes. A Git-based CMS or a visual editor handles the commits for them, so the client works in a form or on the live page while every change still lands in your repository.

Do I need a headless CMS for a small marketing site?

Usually not. A headless CMS pays off for frequent publishing, many editors or scheduled content; for occasional copy and price changes, content files in the repository are simpler to run.

How do I stop a client edit from breaking the build?

Keep editable text in plain data files, protect the production branch and check each change on a preview deployment before it goes live.

What happens if the client publishes a mistake?

Revert the commit. The revert is recorded as a new commit, the site redeploys, and the history still shows what happened.

Sources

  1. Project structure and organization (nextjs.org, checked November 18, 2026)
  2. Editing files (docs.github.com, checked November 18, 2026)
  3. About protected branches (docs.github.com, checked November 18, 2026)
  4. Decap CMS overview (decapcms.org, checked November 18, 2026)
  5. Get Started and learn about TinaCMS (tina.io, checked November 18, 2026)
  6. Deploying Git Repositories with Vercel (vercel.com, checked November 18, 2026)
  7. git-revert Documentation (git-scm.com, checked November 18, 2026)

Related

More from the blog

Let your clients edit the site you coded

One website free. Then $1 each, paid once.

Get started free