14 min read

Site Builder: SEO, Custom Code and Redirects

Set the search title, description, social image and structured data for each page, add allowed head and body code, author redirect rules and a 404 page in the site builder.

Everything search engines and social networks see about your pages is set inside the site builder, per page and for the whole site. This guide covers the Page SEO panel, the Site settings · SEO panel, what custom code is allowed, and redirects.

Open the SEO settings

  1. Go to Hosting and open Hosted Apps, then open your site and click Edit in Builder.
  2. In the left rail click Pages to see your page list.
  3. Use a page's Page settings button to open that page's settings. The Page URL slug field and the Page SEO panel are there.
  4. The Site settings · SEO panel is a collapsible section in the same Pages panel. It is a full-width row titled Site settings · SEO with a chevron at the right. It starts closed. Click the row to open it (the chevron points up) and click it again to close it.

Page SEO (per page)

FieldWhat it does
SEO titleThe title shown in search results. A counter helps you stay near 60 characters.
SEO descriptionThe snippet shown in search results. A counter targets 160 characters.
Hide from search enginesWhen on, the page asks search engines not to index it.
Canonical URLThe preferred address for this page, used to avoid duplicate-content issues.
Social title overrideA different title for link previews on social networks.
Social description overrideA different description for link previews.
Twitter cardUse default, Summary, or Large image summary.
Choose page social imagePick the image used when the page is shared.
Structured data presetNone, Organization, Website, Web page, Local business or Product. Fills JSON-LD from this page's title, description, canonical URL and social image.

Under the fields, Search preview and Social preview show roughly how the page will look.

Write the title and description

Open Page settings for the page, then fill in SEO title and SEO description. Watch the counters.

Choose a social image

Click Choose page social image and pick or upload an image from your media library.

Add structured data if it fits

Pick a Structured data preset, such as Local business for a shop page. Leave it as None if none applies.

Publish

Click Publish. Search and social tags are written into the page when you publish.

Site settings · SEO (whole site)

ControlWhat it does
Site name for social sharingThe site name shown in link previews.
Choose faviconThe small icon in browser tabs.
Choose default social imageUsed for any page that has no page social image.
404 pagePick None or one of your pages to show when a visitor opens an address that does not exist. It is published as the site's not-found page. With None and no page whose slug is 404, the builder adds a branded default, described in Not-found (404) page.
RedirectsA table of redirect rules, described below.
Custom head code and Custom body codeExtra markup added to every page, with the restrictions below.

Not-found (404) page

A visitor who opens an address that does not exist sees your site's 404.html, unless the site is in single-page app mode (see the note below). You never end up with the generic host error page, because the builder always supplies a 404 when you publish.

Which page is used, in order:

  1. The page you pick in Site settings · SEO under 404 page.
  2. Otherwise, a page you made whose Page URL slug is 404.
  3. Otherwise, a branded default that the builder adds for you. It uses your site's header, footer and design tokens (colours and fonts), shows the heading "Page not found" with the line "The page you are looking for may have moved or no longer exists." and a Back to home button that links to your site's own home page. It is marked not to be indexed by search engines.

On phones (the Mobile range) the default is laid out as a single column: the "404" label, the heading, the line of text and the Back to home button are stacked in order, each inset 16 px from the left and right edges, and the heading is smaller (32 px instead of 52 px) so it fits the phone width. Desktop and Tablet are unchanged.

The default never appears in your Pages list or navigation, and you cannot edit it directly. To change its wording or look, make your own 404 page.

The Back to home link in the default is a relative link to the home page file (index.html), not to the domain root /. It works correctly when the missing address is at the top level of your site (for example /old-page) and in a downloaded ZIP or offline copy. It also follows your home page if you change which page is home. On a missing address nested in folders (for example /blog/old/post), the relative link resolves inside that folder and can lead to another missing page.

Re-importing an exported site

The default 404 is stamped with a hidden marker (a wb-generated meta tag in its head). When you re-import a ZIP that the Site Builder exported (see Importing a Site), the importer sees the marker and skips that 404.html, so you do not get an extra "Page not found" page in the editor. Your site then falls back to the default again on the next publish.

  • Only a file named 404.html or 404.htm is checked for the marker. Any other page that happens to contain the same text is imported normally.
  • A 404 page you made yourself never carries the marker, so a hand-made 404.html is still imported as a page.

Why did my 404 page not appear after re-import?

  • If the ZIP's 404.html was the builder's default, skipping it is expected. It is regenerated on every publish, so nothing is lost. To get an editable 404 page, make one as described above.
  • If you made your own 404 page (picked under 404 page, or with the slug 404), it is not marked and does import as a normal page. Check the Pages list.
  • "Back to home" goes to a missing page: this happens when the missing address is nested (such as /blog/old/post), because the button's link is relative to the address the visitor is on. Visitors can use your header logo or navigation to get home instead.
  • The import does not restore the 404 page choice. After a re-import, open Site settings · SEO and set 404 page again.

Make a page for it

In the left rail click Pages, add a page, and design it like any other page. Your global header and footer are applied to it automatically.

Use it as the 404 page

Open Site settings · SEO, set 404 page to that page. (Alternatively, set the page's Page URL slug to 404 and leave 404 page on None.)

Publish

Click Publish. Open an address that does not exist on your live site to check.

Single-page app mode hides the 404 page

If the site's routing mode is Single-page app (SPA), an unknown address without a file extension is answered with your home page instead of the 404 page. Open the site in Hosting, go to its Settings tab and choose Static / multi-page, then click Save settings, to show your 404 page. Details are in Uploading Your Site.

Choosing a deleted page

If the page chosen under 404 page no longer exists, publishing fails with "SEO 404 page does not exist" rather than falling back to the default. Set 404 page to None or pick another page.

Custom code: what is allowed

Custom code is deliberately limited for visitor safety. The hint under the fields reads: "Allowed: meta tags, icon / preconnect / alternate / manifest links, and JSON-LD. Executable scripts and event handlers are removed on export." A Removed on export line lists anything the builder stripped.

  • Allowed: meta tags, link tags with a rel of icon, preconnect, alternate or manifest (with a safe address), and JSON-LD structured data scripts.
  • Removed: all other scripts, event handler attributes such as onclick, other tags, loose text and unsafe addresses.
  • Published sites also enforce a strict content security policy, so scripts from other sites cannot run even if added by another route.

Analytics tags

Google Analytics and Meta Pixel are not added through custom code. Use the one-field integrations described in Analytics, SEO & Security.

Redirects

Use the Redirects table to send visitors from an old address to a new one when you rename, move or remove a page. The builder validates the rules and saves them with your site, and publishing includes them in the site files as _redirects.json. Hosting reads that file when it serves your site, so a visitor who opens an old address is forwarded to the new one.

The builder also fills this table for you: changing a page's URL slug or moving it with Move under… adds a 301 row automatically. See Old addresses keep working.

How a redirect is matched on the published site

  • A rule matches the From path exactly. The query string and one trailing slash on the visitor's address are ignored, so /old-page/ and /old-page?ref=ad both match /old-page. There are no wildcards.
  • A page or file that really exists at the old address wins over a rule. A rule only fires when nothing is published at that address, so if the old address still shows a page, delete or rename that page first.
  • The visitor's browser is sent to the Destination with the status you chose: 301 · Permanent or 302 · Temporary. A destination that is a /path stays on your site; a full http or https address leaves it.
  • If two rows have the same From path, the first one in the table is used.
  • A rule that redirects an address to itself is ignored.

Open the Redirects table

In Site settings · SEO, find Redirects and click Add redirect.

Fill in the row

From path is the old address, starting with a single slash, for example /old-page. Destination is a /path on your site or a full http or https address. Status is 301 · Permanent (the page moved for good) or 302 · Temporary.

Save

Click Save redirects. The button is disabled while any row has an error, and "Redirects saved" confirms success. Use Remove redirect to delete a row.

Publish

Publish to include the rules in your site files. Once the new version is live, opening the old address forwards to the destination. Saved rules are not live until you publish.

Rows are validated as you type:

MessageFix
Start the source path with a single /.Begin with one slash, not two.
Enter a /path or an http(s) URL.Use a path on your site or a full web address.
This source path is already used. Choose a unique path.Each old address can only appear once.
This redirect forms a loop. Change its destination.Two or more rules point at each other.
Choose status 301 or 302.Pick one of the two statuses.

Publishing is blocked with an "Invalid SEO redirects" error if a saved row is still invalid.

Before you publish: the checklist

When you click Publish, the builder first checks the site. If it finds anything to flag, a Before you publish dialog opens with the note "These won't stop you from publishing, but fixing them helps search and screen-reader visitors." If there is nothing to flag, Publish goes straight ahead.

Click Publish

In the top toolbar click Publish. The dialog lists up to four groups.

Read the groups

Pages missing an SEO title and Pages missing an SEO description list each page whose SEO title or description is empty. Images missing alt text lists each image as "Image on your page" (or "Image on your page: file name"). Site scripts appears only for an imported site that carried JavaScript, and is information only.

Fix an item, or go on

Click Add in page settings next to a page to open its SEO settings, or Select image next to an image to select it on the canvas. Click Keep editing to close the dialog without publishing, or Publish anyway to publish with the items still open.

The checklist never blocks publishing. For an imported site with scripts, the Site scripts line says either that site scripts are off so none of them run on the published site, or that they are switched on but publishing site scripts is not available yet, so the published site stays script-free.

Why does the checklist keep listing a page?

A page counts as missing its SEO title or description until the field in Page SEO has text in it. A field that only holds spaces counts as empty. Fill the field, then click Publish again.

Troubleshooting

Where are the site-wide SEO fields?

In the Pages panel, find the row titled Site settings · SEO and click it. It starts closed, so the fields are hidden until you open it.

Why does my page still show the old title in Google, why does my redirect do nothing, or why do I see a generic 404?

  • Search engines refresh on their own schedule; a changed title can take days to appear.
  • Check Hide from search engines is off, and that the page is not set as noindex.
  • Make sure you clicked Publish after changing SEO or Save redirects; SEO settings only go live when published.
  • An old address still opens the old page instead of redirecting. A page or file that exists at that address wins over a redirect. Rename or delete that page, or change its slug, then publish again. Also check that the From path matches exactly (no wildcards) and that you clicked Save redirects and then Publish.
  • An old address still works after I changed a page's slug. That is the automatic redirect the builder added to the Redirects table, so it is working as intended. To stop it, remove the row, click Save redirects and publish. Untick Redirect the old URL to the new one before the next slug change to avoid creating one.
  • A redirect does not fire on the live site. Confirm the row is saved and published, and that the From path starts with one slash and is not the same as the Destination. A row that fails validation blocks publishing, so a published site only holds valid rules. If the old address still shows a "not found" page, check these causes: rules only go live in a published version of the site, so if you saved the rule after your last publish, publish again; the From path must match the old address exactly; and a page that exists at that address wins over the rule.
  • A script you pasted into custom code will not run; scripts other than JSON-LD are removed by design.
  • Unknown addresses show your home page instead of the 404 page. The site's routing mode in its Settings tab is Single-page app (SPA); switch it to Static / multi-page. Addresses ending in a file extension, such as /missing.png, still get the 404 page.
  • A plain "Page not found" page with a Back to home button on your live site is the built-in default. It appears when 404 page is None and no page has the slug 404. Pick or create your own 404 page, then publish again. A site published before this default existed gets it the next time you publish.