The Netlify Visual Editor allows you to edit your website’s content directly on the live preview of your site, with all changes being committed back to your Git repository.

Let’s see it in action. Imagine you have a simple blog post on your site. With the Visual Editor enabled, you’d navigate to that blog post’s page on your live Netlify-deployed site. You’d then click an "Edit" button (usually in the corner of the screen, often visible only when you’re logged into Netlify). This action opens up the Visual Editor interface, overlaying your site. When you click on a piece of text, like the blog post title, a small editing panel appears. You can then directly modify the text within this panel.

Once you’ve made your changes, you’d click a "Save" or "Commit" button within the Visual Editor’s UI. This triggers Netlify to create a new commit in your Git repository, containing the updated content. The commit message is usually pre-populated with a summary of the changes, like "Updated blog post title". Netlify then rebuilds your site with the new content, and the changes are live.

The core problem the Visual Editor solves is the disconnect between content management and the development workflow. Traditionally, content editors might have to log into a CMS, extract content, and then hand it off to a developer to commit it to Git and deploy. This process is slow, error-prone, and creates a bottleneck. The Visual Editor bridges this gap by bringing content editing directly into the Git-based deployment pipeline.

Internally, the Visual Editor works by inspecting your site’s rendered HTML and identifying elements that are associated with your content. It uses data attributes (often starting with data-cms-edit-) injected into the HTML during the build process to map specific HTML elements back to their corresponding data sources in your Git repository, typically Markdown files, JSON, or YAML. When you edit content, the Visual Editor modifies the data in memory, and upon saving, it serializes this modified data back into the correct file format and then uses the Git command-line interface (or a similar Git API) to stage, commit, and push the changes.

The key levers you control are:

  • Content Identification: You need to ensure your site’s frontend framework or static site generator is configured to add the necessary data-cms-edit-* attributes to your content elements. This is usually done via a plugin or a specific configuration step. For example, in a Next.js site using a custom Markdown parser, you might configure your parser to wrap paragraphs with <p data-cms-edit-field="content"> and headings with <h1 data-cms-edit-field="title">.
  • Data Source Configuration: Netlify needs to know where to find the content. This is typically configured through your netlify.toml file or through the Netlify UI. You define which files or directories contain the content that the Visual Editor should manage. For instance, you might specify content_dir = "content/" or content_files = ["blog/*.md", "pages/*.json"].
  • Branching Strategy: While you can configure the Visual Editor to commit directly to your main branch, it’s often recommended to have it commit to a dedicated content editing branch, which can then be reviewed or merged via a pull request. This is a setting within the Visual Editor’s configuration in Netlify.

When you enable the Visual Editor on a site that uses a framework like Next.js or Gatsby, the build process typically involves a step where the framework’s plugins or your custom code injects these data-cms-edit-* attributes into the HTML output. These attributes serve as unique identifiers, linking a specific piece of rendered content on your page back to its source file and field within your Git repository. Without these attributes, the Visual Editor wouldn’t know what content to target for editing or where to save the changes.

The next concept you’ll likely explore is integrating more advanced content types, such as images or complex structured data, into the Visual Editor workflow.

Want structured learning?

Take the full Netlify course →