Installation
Install AI Pages with one click on Cloudflare, the Trakkr plugin on WordPress, a pull request on Next.js, or a link for your developer. Then prove it works.
On this pageFour ways to install
Installing AI Pages puts a small piece of code in front of your site. It checks who is asking. A crawler in a group you have on can get the AI version of the page, and everything else, including every person, goes straight to your site.
Start at /ai-pages. The first screen shows your homepage as AI reads it now, next to what it would get. Nothing touches your site until you press Turn it on. Trakkr then looks at how your site is hosted and offers the route that fits.
Four ways to install
| Your site | Route | What you do |
|---|---|---|
| On Cloudflare | One click | Press Add it for me and connect Cloudflare once. About a minute |
| On WordPress | The Trakkr plugin | Turn AI Pages on in the plugin. No file to upload |
| On Next.js | A pull request | Press Open pull request. It adds one small file, and your developer reviews it like any other change |
| Anywhere, if someone else deploys | A link for your developer | Press Send to my developer and copy the link. It opens the code, the steps and a live check, with no sign-in |
I'll do it myself shows the code and steps for your host instead, and Install code in the page bar brings them back later.
One click on Cloudflare
Trakkr adds a Cloudflare Worker and its routes to your zone for you. The Worker only acts on AI crawler requests, and if anything fails, people and crawlers get your normal page. Your domain's DNS records need the orange cloud (Proxied), or requests never reach Cloudflare. The install checks tell you if one doesn't.
The Trakkr plugin on WordPress
One Trakkr plugin covers AI Pages, crawler tracking and publishing. Turn AI Pages on in the plugin, then purge your page cache once if your host or a plugin keeps whole pages (SiteGround, WP Engine, Kinsta, LiteSpeed servers, WP Rocket and others). From then on, saving a post starts a refresh check for that page.
A crawler that hits a page your host saved gets the normal page, because WordPress never runs. To reach every crawl, ask your host to skip the page cache for the crawlers you have on.
A pull request on Next.js
Pick the repository and press Open pull request. The file it adds checks each request and passes everything but crawlers through. If your project already has middleware, your developer merges the two when reviewing it.
A link for your developer
The link opens the code, the steps and a Check button, and your developer doesn't need a Trakkr login. We tell you when the first crawler arrives. On a client portal, the page carries your agency's name.
Hosts that won't run your code
The way in, where there is one, is to put Cloudflare in front of the site.
| Host | Answer |
|---|---|
| Webflow | Yes, with Cloudflare in front and a paid Webflow Site plan. Choose Another host |
| Squarespace | It can work the same way, but Squarespace warns that a proxy can interfere, so test the site first |
| Framer | Only on the Enterprise proxy setup Framer approves. Confirm with Framer first |
| HubSpot | Only on the Cloudflare Enterprise setup in HubSpot's reverse proxy guide. Confirm with HubSpot first |
| Shopify | No. Shopify doesn't support a proxy in front of a hosted store. Themes already send crawlers server-rendered pages, so use Optimize |
| Wix | No. Wix doesn't support a proxy. Use Optimize |
Copy the code yourself
Install code generates the code with your key already in it, and the steps for your host, including the file name to use. The right method depends on where requests actually end, not on which CMS you write in.
| Method | Runs on | Use when |
|---|---|---|
| Cloudflare | Cloudflare Workers | Cloudflare already fronts your domain |
| Vercel | Vercel Edge Middleware | Your Next.js app is deployed on Vercel |
| Netlify | Netlify Edge Functions | You are on Netlify |
| Next.js | Next.js middleware | Next.js, hosted somewhere other than Vercel |
| CloudFront | Lambda@Edge | CloudFront sits in front of your site |
| WordPress | PHP | You'd rather upload one file than use the plugin |
| Node.js | Express | You run your own Node server |
| Nginx | OpenResty (Lua) | Self-hosted behind Nginx with OpenResty |
| Another host | Cloudflare in front of your site | Your host allows a proxy but won't run your code |
The code holds your API key as a literal value, so treat the file like any other deploy secret. If it leaks, press Make a new key in the install drawer and deploy the code again. The old key stops at once.
Cloudflare
Deploy one Worker and bind it to every hostname a crawler can reach. Cloudflare only runs a Worker on a matching route, and a route for the apex does not cover www:
yourdomain.com/*
www.yourdomain.com/*Keep both when your site redirects between them, check that both DNS records are proxied (orange cloud, not grey), and check that no more specific route is assigned to a different Worker or to none. Cloudflare's free Workers plan is enough to verify an install. Review their limits before running a high-traffic site through it.
Vercel and Next.js
Save the code as middleware.ts at the project root, next to package.json, then commit and push. If you already have a middleware file, merge the logic into your existing function rather than replacing the file. Behind a CDN or load balancer, pass the visitor's Host header through to your app.
Netlify
Save the code as an edge function, register it in netlify.toml with path = "/*", then deploy. The drawer gives you the exact block. Edge functions run on Deno, which is why the generated imports are Deno-style.
CloudFront
Create a Node.js 20.x Lambda function in us-east-1, paste the code, publish a version rather than using $LATEST, then attach that version to your distribution as a viewer-request trigger. Viewer-request responses are capped at 40 KB, and the code checks the size and falls through to your site when the AI version is larger.
WordPress, by hand
Upload the file to wp-content/mu-plugins/. Must-use plugins load with no activation step. Managed hosts that block writes to that folder need the plugin or Another host. Then purge your page cache once, as above.
Node.js and Nginx
For Express, register the code ahead of your routes so it runs before your handlers. For Nginx you need OpenResty and lua-resty-http (opm get ledgetech/lua-resty-http), then add the generated block to your server {} block and reload. Nginx is the most involved method and only worth it if you already run OpenResty.
Another host
You are not changing your site, you are putting Cloudflare in front of it. Sign up for Cloudflare (no cost), add your domain, make sure your main A or CNAME record is proxied, move your nameservers at your registrar, then deploy the Worker and add the routes as in the Cloudflare method.
What the code does
Every method runs the same steps. Only the syntax and the file location change.
- 1If the path ends in a static asset extension (
.js,.css, an image,.pdf,.xml,.txt), pass through and stop. - 2Look for a known crawler in the
User-Agentheader. - 3No match: pass through to your site, with no extra network call.
- 4Match: ask Trakkr for this page, sending the URL, the crawler name and your key. The wait is capped at 1 second on Cloudflare and 1.5 seconds elsewhere.
- 5If Trakkr returns an AI version, serve it with
X-Trakkr-AI-Pages, full no-store headers andVary: User-Agent. On anything else, serve your normal page.
The no-store headers matter. A page cache or CDN that stored a crawler's response would hand it to every later visitor, people and search engines included. If you merge the logic into your own code, keep them.
Settings live on our side, so the code stays small and stays put. It tells Trakkr its version on each request, which is how the status line knows when an install is out of date.
Checking it works
Until the first crawler arrives, the page names the next step in order:
- 1The code is deployed. If a check fails, it says which one and what to do. For example, a
wwwhostname on a DNS-only record skips the Worker, and the fix is to turn the proxy on for that record. - 2First crawler arrives. This can take a few days, which is normal. Real crawlers come on their own schedule.
- 3Your pages, ready to go. Trakkr builds your cited pages before the first crawler arrives, and you can look at them on the Pages tab while you wait.
Check now sends one GPTBot test request to your site and checks that it reaches AI Pages. Test requests stay out of your traffic figures on purpose.
Once you're live, the people and crawlers check runs on your homepage every 4 hours.
Checking by hand
Ask for a page as a crawler and look at the response headers:
curl -sS -D - -o /dev/null \
-A "Mozilla/5.0 (compatible; GPTBot/1.0; +https://openai.com/gptbot)" \
"https://yourdomain.com/"An AI version carries an X-Trakkr-AI-Pages header. Without it, you got the normal page, which is fine for a page that isn't built yet or isn't kept. Look it up on the Pages tab before assuming the install is at fault. An install older than this header won't send it, and the status line tells you when that's the case. This command counts as a crawler request in your figures.
Where crawler requests appear, and how fast
| Where | Lag |
|---|---|
| AI Pages, Overview | Seconds |
| Crawlers | Up to 30 minutes |
Setup creates a crawler tracking connection for the domain, and that connection is pulled every 30 minutes because it merges with every other source you have connected. An empty Crawlers feed right after a fresh install usually means the first pull hasn't run yet.
When the install does not work
The code never runs
Either it didn't deploy, or it deployed somewhere requests don't go. On Cloudflare, confirm the current version is deployed to production, add exact routes for both apex and www, confirm both DNS records are proxied, and look for a more specific route overriding yours. Elsewhere, confirm middleware.ts is at the project root, check wp-content/mu-plugins/, or run nginx -t. The usual cause is a deploy to the wrong hostname or environment.
People see the AI version
Ask for a page with a normal browser user agent. If the response carries X-Trakkr-AI-Pages, or the status line says people are getting the AI version, a page cache stored a crawler's response and is serving it to everyone:
curl -sS -D - -o /dev/null \
-A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" \
"https://yourdomain.com/about/"Update your install to the current code, which marks the AI version so page caches leave it alone, then purge your host, plugin and CDN caches. On SiteGround, use Speed Optimizer → Purge SG Cache or run wp sg purge.
Trakkr rejects the key
The check reports the request as unauthorized. Your deployed code holds an old key, most often because a new one was made in Trakkr afterwards. Copy the current code from Install code, deploy it, and check again.
The AI version looks wrong
Open the page on the Pages tab and compare Your page with AI version, or run the URL through Test a page. The usual causes are content that only appears after a scroll, a consent banner that dismisses itself for people but not crawlers, and lazy-loaded sections that need a trigger. Roll back puts an earlier version in front of crawlers, and Leave out takes the page out altogether.
The site is down after installing
Roll back first: remove the Worker, delete middleware.ts, or turn AI Pages off in the plugin. Your site returns immediately. The code is built to fall back to your normal page, but a syntax error in the file itself can break the whole deploy, so debug it outside production.
Common questions
Do I have to change the code when I change settings?
No. What crawlers get, crawler groups, left-out paths and approval all live on our side. You only change the code for a new host or a new key. An older install forwards only the crawlers it was generated with, so update it if a group you switched on isn't getting the AI version.
Why is the page still empty a day after installing?
Because real crawlers arrive on their own schedule and can't be summoned. A correct install can sit quiet for a few days. Use Check now to confirm the wiring, and look at your built pages on the Pages tab while you wait.
Does the code slow the site down for people?
No. A visit that doesn't match a crawler is passed to your site with no extra network call, and static assets are skipped before the check even runs.
Can I run this alongside crawler tracking I already installed?
Yes, and AI Pages sets up its own crawler tracking connection for the domain. If you also run the standalone tracker described in Install crawler tracking, keep one connection per domain so requests aren't counted twice.
