Redirects and custom code

Send old addresses to new ones with permanent or temporary redirects, cover whole sections with a wildcard, import and export them as CSV, and add analytics, chat widgets and verification tags to every page or just one.

Updated · 3 min read

Admin → Site settings has two cards for moving to this site from another one: Redirects, so old links and search rankings carry over, and Custom code, for the analytics, chat widget and verification tags your old site had.

Redirects and custom code

Redirects

Add a redirect by typing the old address and where it goes, then choosing Permanent (301) or Temporary (302). Use permanent for a page that has moved for good: search engines move its ranking to the new address. Use temporary for a campaign or a page that's coming back.

  • On this site or elsewhere. The new address can be a page here, like /pricing, or a full https:// address on another site.
  • Whole sections. End the old address with /* to cover everything under it: /blog/* catches /blog, /blog/launch and /blog/2024/launch. End the new address with /* too to keep the rest of the path, so /blog/* → /articles/* sends /blog/launch to /articles/launch.
  • The query is kept. /old?utm_source=mail arrives at /new?utm_source=mail.
  • Old file addresses work. An old site's /about.html can redirect like any other address.
  • The most specific wins. An exact address beats a wildcard, and /blog/news/* beats /blog/*.

Each redirect shows how often it has been followed and when it was last used, so you can see which old links still bring visitors. Edit one in place, delete one (with Undo), or tick several and delete them together.

Import and export

Import CSV takes a file or pasted lines of old,new with an optional 301 or 302:

from,to,status
/old-pricing,/pricing
/blog/*,/articles/*
/team,https://example.com/about,302

A header row is skipped, commas, semicolons and tabs all work, and up to 1,000 lines go in at once. Before anything is sent, the dialog says how many redirects are ready and lists each line it can't use with the reason. An old address that already redirects is updated rather than added twice. Export downloads every redirect in the same format.

What can't redirect

  • The home page, and an old address of /* that would catch everything.
  • The app's own addresses (/admin, /account, sign-in and the rest) and the API.
  • An address where a page is published. A published page always wins: unpublish or rename it first. A wildcard that happens to cover a published page leaves that page alone.
  • Addresses with a query, a # or spaces: redirects match the path only.

Renaming a published page in the editor adds its own redirect automatically. Those are listed under Renamed pages.

Custom code

Custom code has two boxes, each holding up to 20,000 characters:

  • In the head: analytics (Plausible, Google Analytics, PostHog), fonts, meta tags and site verification. It runs before the page draws.
  • End of the body: chat widgets and scripts that need the page in place, such as Intercom or Crisp. Google Tag Manager's <noscript> fallback can go here too.

Saving puts the code on every public page at once: site pages, answers, docs and the free tools. It never runs in the app, the admin, the editor or a preview, so a broken tag can't lock you out of fixing it.

A single page can add its own head code in the editor: open the page's settings and find Custom code. It goes live when you publish the page, so a draft's code waits with the rest of the draft.

Some things to know:

  • Paste only code from a provider you trust: it runs for every visitor. After saving, open the live site and check it.
  • Code runs once when a visitor arrives. Moving between site pages swaps each page's own head code, and the site's code keeps running. A visitor who first lands in the app and then opens a site page gets the site's code from that page on, and going on into the app or the admin loads it without the code.
  • The audit log records that the code changed, not the code itself.

Something unclear or missing? Ask us and we'll answer, then fix the page.

Was this page helpful?

Built with Overlays