How to Build Client Websites with AI and Hand Over Editing
Let AI help build the structure, design and first draft of content, then give the client an editor that can change words and images but not layout, code or settings. Enforce that limit on the server, sanitise rich text and uploads, and hand over a short sheet covering logins, editing and backups.
The handover problem with AI-built sites
AI tools make it quick to produce a polished client site. The trouble starts the week after launch, when the client wants to change opening hours, swap a photo or add a team member. If the site is hand-written or generated code, every edit becomes a request to you. If you give the client full access to a page builder, they can break layouts, delete sections or paste in scripts.
A good handover sits between those extremes: the client edits content freely, and structure stays yours.
Separate structure from content
Model each page as structured data rather than one blob of HTML. A common shape is sections, containing columns, containing typed blocks. Each block type declares its fields: a heading has text, an image block has an image and alt text, a pricing table has a list of plans.
That model does three jobs. Rendering is consistent because templates draw the markup. Validation is possible because every field has a type. And permissions become precise, because you can say which field types a client may change.
It also keeps the client's content portable. If the page is stored as JSON describing blocks and their text, you can restyle the whole site, switch design systems or move hosts without retyping a word. If the content is baked into generated HTML, every redesign starts with copy and paste.
Use AI in the build without losing control
AI is strongest at the parts of a client site that used to eat the most time: first-draft copy, page outlines, alt text, variations of a hero section, and turning a messy brief into a site map. Use it there, and keep humans on decisions the client will be held to.
- Turn the client's brief into a page list and a section outline for each page. Review it with the client before building.
- Build pages from your existing blocks rather than letting the agent invent one-off markup. Consistent blocks are what make content-only editing possible later.
- Generate draft copy, then have the client approve facts, prices, claims and legal wording. AI-written copy can state things that are not true about the business.
- Check accessibility: heading order, alt text, colour contrast and link text.
- Set page titles and descriptions for search, and confirm every page has one clear purpose.
If an agent is writing code as well as content, the advice in why agents build better on a working boilerplate applies: give it patterns to copy and checks to run.
Enforce content-only access on the server
Hiding the "delete section" button is not a permission system; a crafted request can still send a new layout. Enforce the rule where the data is saved. Load the stored page, then copy across only the editable fields from the submission, matched by position and block type:
$editable = ['text', 'textarea', 'richtext', 'media'];
foreach ($stored['blocks'] as $i => $block) {
$sent = $submitted['blocks'][$i] ?? null;
if (!is_array($sent) || ($sent['type'] ?? '') !== $block['type']) {
continue; // structure must match exactly
}
foreach (block_fields($block['type']) as $field) {
if (in_array($field['type'], $editable, true)
&& array_key_exists($field['key'], $sent['props'] ?? [])) {
$stored['blocks'][$i]['props'][$field['key']] = $sent['props'][$field['key']];
}
}
}
save_page($pageId, sanitise_layout($stored)); // title, slug and status stay as stored
Give yourself a separate full-access role for creating pages, changing structure and editing site-wide settings. Keep the client out of anything that can break the whole site: navigation structure, page slugs, publishing status of the homepage, and raw HTML blocks. If a client genuinely needs to add new pages, give them a few pre-built page templates to duplicate rather than a blank canvas.
Sanitise everything a client can enter
- Rich text: run it through an allowlist sanitiser on save. Keep a small set of tags and attributes; strip
script, inline event handlers andjavascript:URLs. - Links: allow
http,https,mailtoand relative paths only. - Uploads: check the real file type, re-serve images from your own route, and reject SVG unless you sanitise it, because SVG can carry script.
- Embeds: accept a YouTube or Vimeo ID and build the embed yourself, rather than letting clients paste iframe HTML.
- Colours and sizes: accept named options or strict formats, never raw CSS.
A Content Security Policy is a useful second layer, but server-side sanitising is the first. Sanitise on save rather than only on display, so a bad value never sits in the database waiting for a template that forgets to escape it. And keep the editor itself behind sign-in with CSRF protection on every save, because a forged request from a client's browser would otherwise carry their editing rights.
A handover checklist
- Create the client's own login with content-only access. Keep your full-access account separate.
- Write a one-page editing guide with screenshots: change text, swap an image, preview, publish.
- Confirm who owns the domain, DNS and hosting accounts, and who pays for them.
- Set up automatic backups, restore one, and note who to call if something goes wrong.
- Agree in writing what support includes and what counts as new work.
- Check the licence of any template, theme or starter you used allows client work.
If you host client sites yourself, the VPS deployment guide covers HTTPS and backups, and the real cost of self-hosting helps you price the ongoing work.
When WordPress or a hosted builder is the better fit
If the client needs a large plugin ecosystem, many editors with editorial workflows, or wants to replace you easily with any agency, WordPress or a hosted builder may serve them better. A lean, self-hosted CMS suits brochure sites, landing pages and small product sites where you want control over the code, the design and the hosting bill. It also means fewer third-party plugins to keep patched, which matters if you look after many small client sites at once. Whichever route you take, the principle is the same: the client controls the words and pictures, and you control everything that can break.
Sources: OWASP XSS Prevention Cheat Sheet · OWASP File Upload Cheat Sheet
How Simple Stack handles it
Simple Stack includes a no-code page builder (app/cms.php, documented in CMS.md) with two levels of editor access you assign per user from the admin user page. The licence allows unlimited own and client projects.
- Page builder with 26 block types, ready-made sections and a desktop/mobile preview
- Simple access lets a client edit text and images only; the server enforces it on save
- Full access adds new pages, structure changes and site settings
- Rich text is sanitised on save; uploads are raster-only and SVG is rejected
- SITE_DESIGN switches the public site between 43 bundled design systems in one line
- A client who wants its own reusable copy of the starter source needs its own licence
Questions people ask
Skip the plumbing. Build the product.
Sign-in, Stripe, emails, an admin and a CMS — already built and tested in plain PHP. £49, once, for unlimited projects.