# Purge the WordPress cache with OpenClaw

> Purging the WordPress cache with OpenClaw means having an always-on agent clear the xSpeed cache on a site when you ask, or from an automation you set up, through the xSpeed Hub server connected to it.

Page: https://xspeedcache.com/agent/openclaw/purge-cache/
Last updated: October 2026

OpenClaw is the agent that is already running when you need it. You might message it after a deploy, or you might have an automation that fires overnight once your content team has published. Either way you say which site and which purge type, for example: purge the page cache on blog and start the preloader. It calls list_sites, then purge_cache, then start_preloader, and reports what happened.

Scheduling is OpenClaw's side, not the Hub's. xSpeed Hub has no scheduler for agent prompts, so a timed purge is an automation in OpenClaw that calls the Hub when it fires. Each run returns the same report as a manual one: type, site, entries cleared, and for all the object cache and a connected Cloudflare edge. For an overnight run, write the prompt so it names the site and the type, which leaves nothing for the agent to guess. An automation can also carry its own tools allowlist, so list only the tools that job needs.

An unattended run changes the approval picture. If nobody is there when the automation fires, nobody answers a prompt, and the Hub's instruction to confirm a purge across every site is guidance to the model, not a lock. OpenClaw gives you two gates. A tool filter on the server decides which Hub tools the agent can call at all, so a list of read tools keeps purge_cache out of reach. When the Codex runtime runs your turns, the server can also be set to prompt on every call, but the default full-permission posture does not prompt. Decide those before you schedule a write, and re-read them whenever you change what the automation does.

## Set up OpenClaw once

### 1. Put your sites in xSpeed Hub

Sign in at app.xspeedcache.com with Google or email; the Hub is free and has no site cap. Then connect each WordPress site from its own dashboard: click Connect Hub in the xSpeed Cache top bar, then Connect via xSpeed Hub. Each site needs the free xSpeed Cache plugin.

### 2. Save xSpeed Hub as an MCP server

Run this on the machine that hosts your OpenClaw Gateway. Set the transport to streamable-http: OpenClaw falls back to SSE when you leave it out. With --auth oauth the command saves the server without a connection test, because sign-in has to happen first.

```bash
openclaw mcp add xspeedhub \
  --url https://app.xspeedcache.com/xspeed/mcp \
  --transport streamable-http \
  --auth oauth
```

### 3. Sign in with openclaw mcp login

OpenClaw prints an authorization URL and listens on a loopback address for the callback. Open the URL, sign in to xSpeed Hub and approve; the token exchange finishes by itself. There is no token to paste. If your browser is on another machine, copy the code from the redirect and pass it back with openclaw mcp login xspeedhub --code. Then check the connection.

```bash
openclaw mcp login xspeedhub
openclaw mcp doctor xspeedhub --probe
```

Full setup: https://xspeedcache.com/agent/openclaw/

### Before you send a prompt that changes something

Reads change nothing on your sites, though contact_support emails xSpeed support. Writes run once your connection allows them, so your client's approval prompt and a read-only connection (the token's Read-only everywhere switch, or a Viewer sign-in) are the gates that matter. OpenClaw gives you two client-side gates, and the Hub adds none. First, openclaw mcp tools xspeedhub --include limits which tools exist for the agent, so a list of read tools keeps every write out of reach. Second, when the Codex runtime runs your agent turns, MCP tool approvals follow the session's permission posture, and the default full-permission posture does not prompt. openclaw mcp configure xspeedhub --approval prompt asks on every call, and Allow Always saves a grant for that one tool with any arguments. OpenClaw's docs describe that per-call prompt for the Codex runtime; with its own embedded runtime, use the tool filter to decide what the agent can call. The Hub has no confirmation step of its own.

## Prompts

- After the nightly content publish, use xSpeed Hub to purge the page cache on blog, start the preloader, and report how many URLs were queued.
- Every morning, ask xSpeed Hub for the cache status of every site and message me any with a hit ratio under 60%. Do not purge anything.
- Use xSpeed Hub to purge shop now, and tell me plainly if the purge was refused or the connection is read-only.

## Example session

```
You: Test run of the nightly job: use xSpeed Hub to purge the page cache on blog and warm it.
  → list_sites [read-only]: 6 sites; blog is blog.example.com
  → purge_cache(site: blog, type: page) [changes site]: 188 cached pages cleared
  → start_preloader(site: blog) [changes site]: preloader started, 188 URLs queued
  → get_preloader_status(site: blog) [read-only]: running, 40 of 188 URLs warmed
Agent: Test run finished: the page cache on blog is cleared and the preloader is at 40 of 188. The same prompt can go into the automation unchanged.
```

## How it works

1. **Find the site**: The agent calls list_sites when you have more than one site, then matches the name you used to a site handle. If the name could mean two sites, the Hub tells it to ask you rather than guess.
2. **Pick the purge type**: purge_cache takes a type: all, page, assets, object or rest. all clears the page cache, the object cache and, when they are connected, the Cloudflare edge and CDN. After a theme or CSS change, assets is enough; after a content edit, page; after a deploy, all.
3. **Purge**: The call runs straight away on that site once your connection allows writes. For every site at once the agent passes site: "all", and the Hub runs the sites one after another with a one-second pause.
4. **Clear only the edge if that is all you need**: purge_cloudflare empties the Cloudflare edge cache on its own, without touching the copies on your server. A page or assets purge does not reach Cloudflare; a purge of type all does when Cloudflare is connected.
5. **Warm it again**: start_preloader rebuilds the cache in the background so the first visitors after the purge are not the ones paying for it.

## Reference

| | |
| --- | --- |
| Tool | purge_cache (write) |
| Purge types | all, page, assets, object, rest |
| What all covers | Page cache, object cache, plus the Cloudflare edge and CDN when connected |
| Every site at once | site: "all" or a list of handles, one result per site |
| Fan-out pacing | Sites run one after another with a 1 second pause |
| Edge only | purge_cloudflare, a separate write tool |
| Re-warm | start_preloader after the purge |
| Read-only access | purge_cache is refused on a connection token with Read-only everywhere on, and for a Viewer sign-in |
| Confirmation | None on the Hub; your client's prompt is the gate |

## Rules

- Name the site. With several sites, an unclear name should make the agent ask, and the Hub tells it to.
- A purge of every site is one call with site: "all". The Hub tells the agent to confirm it with you once before it runs.
- Purge the narrowest type that fixes the problem, then warm the cache, so visitors do not all hit uncached pages at once.
- A fan-out result is reported per site. Treat some sites failing as a partial result, not a failure of the whole call.

## Good to know with OpenClaw

A scheduled purge runs with whatever your connection allows, and the connection has to allow writes for the purge to work at all, so the same connection could be asked to do more. Keep the automation narrow: one named site, one purge type, no site: all, and a tool filter that leaves out toggle_cache and update_settings. The one control that stops every write is the Read-only everywhere switch on the connection token (or a Viewer sign-in), which would also stop the purge, so for a job that should only report, use that and have it read get_cache_status instead.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Use xSpeed Hub to purge the page cache on blog.
- I just changed the theme CSS on shop. Use xSpeed Hub to purge only the assets cache there.
- With xSpeed Hub, purge every site in my workspace and tell me which ones failed.
- Use xSpeed Hub to purge shop, then purge its Cloudflare edge cache too.
- With xSpeed Hub, purge the docs site and start the preloader so it is warm again.
- Using xSpeed Hub, what purge type should I use after updating a plugin that changes the checkout page?

## Frequently asked questions

### Can OpenClaw purge my WordPress cache on a schedule?

Yes, through its own automations. xSpeed Hub has no scheduler for agent prompts, so the timing lives in OpenClaw, which calls the Hub tools when the automation runs. Keep the job narrow: one named site and one purge type.

### Who approves a purge when OpenClaw runs unattended?

Nobody does at that moment. xSpeed Hub has no confirmation of its own, and its instruction to confirm a purge across every site is guidance to the model, not a lock. The gates are the connection scope and OpenClaw's tool filter, plus a per-call prompt when the Codex runtime runs your turns, since the default full-permission posture does not prompt. Set those before you schedule a write.

### What is the difference between the purge types?

all clears every cache xSpeed manages for the site, including a connected Cloudflare zone or CDN. page clears the stored HTML pages, assets clears minified and combined CSS and JavaScript, object clears the Redis or Memcached object cache, and rest clears cached REST API responses.

### Does purging xSpeed also clear Cloudflare?

A purge of type all does, when the site has Cloudflare connected in xSpeed: it clears the page cache, the object cache and the Cloudflare edge, and reports each one. A page, assets or rest purge stays on your server. purge_cloudflare clears only the edge.

### Can I purge all of my sites with one prompt?

Yes. The agent passes site: "all" to purge_cache and the Hub purges every site in the workspace one after another, returning a result per site. The Hub tells the agent to confirm a write across every site with you once before it runs it.

### Will a purge slow my site down?

The next request to each purged page builds it fresh, which is slower than a cached hit. Starting the preloader right after the purge rebuilds the cache in the background so visitors mostly land on warm pages.

## Purge the cache with other agents

[Claude Code](https://xspeedcache.com/agent/claude-code/purge-cache/) · [Claude](https://xspeedcache.com/agent/claude/purge-cache/) · [Claude Cowork](https://xspeedcache.com/agent/claude-cowork/purge-cache/) · [ChatGPT](https://xspeedcache.com/agent/chatgpt/purge-cache/) · [Codex](https://xspeedcache.com/agent/codex/purge-cache/) · [Cursor](https://xspeedcache.com/agent/cursor/purge-cache/) · [GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/purge-cache/) · [Windsurf](https://xspeedcache.com/agent/windsurf/purge-cache/) · [Gemini CLI](https://xspeedcache.com/agent/gemini-cli/purge-cache/) · [Antigravity](https://xspeedcache.com/agent/antigravity/purge-cache/) · [Zed](https://xspeedcache.com/agent/zed/purge-cache/) · [Kiro](https://xspeedcache.com/agent/kiro/purge-cache/) · [OpenCode](https://xspeedcache.com/agent/opencode/purge-cache/) · [Hermes Agent](https://xspeedcache.com/agent/hermes-agent/purge-cache/) · [Grok Build](https://xspeedcache.com/agent/grok-build/purge-cache/) · [ChatGPT dots](https://xspeedcache.com/agent/chatgpt-dots/purge-cache/) · [Grok](https://xspeedcache.com/agent/grok/purge-cache/) · [Grok Bot](https://xspeedcache.com/agent/grok-bot/purge-cache/) · [Muse](https://xspeedcache.com/agent/muse/purge-cache/) · [Manus](https://xspeedcache.com/agent/manus/purge-cache/) · [Kimi Code](https://xspeedcache.com/agent/kimi/purge-cache/) · [Paperclip](https://xspeedcache.com/agent/paperclip/purge-cache/) · [NanoClaw](https://xspeedcache.com/agent/nanoclaw/purge-cache/)

## More with OpenClaw

- [Find out why WordPress pages are not cached with OpenClaw](https://xspeedcache.com/agent/openclaw/troubleshoot-cache/)
- [Scan a website for speed problems with OpenClaw](https://xspeedcache.com/agent/openclaw/speed-scan/)
- [Run and track PageSpeed tests with OpenClaw](https://xspeedcache.com/agent/openclaw/pagespeed-tests/)
- [Raise a WordPress site's PageSpeed score with OpenClaw](https://xspeedcache.com/agent/openclaw/optimize-site/)
- [Tune WordPress cache settings with OpenClaw](https://xspeedcache.com/agent/openclaw/cache-settings/)
- [Warm the WordPress cache with OpenClaw](https://xspeedcache.com/agent/openclaw/preload-cache/)
- [Set up the Redis object cache with OpenClaw](https://xspeedcache.com/agent/openclaw/object-cache/)
- [Manage Cloudflare caching with OpenClaw](https://xspeedcache.com/agent/openclaw/cloudflare/)
- [Manage every WordPress site at once with OpenClaw](https://xspeedcache.com/agent/openclaw/fleet/)

## Documentation

- How to enable Page Cache: https://xspeedcache.com/docs/page-cache/
- How to warm your cache ahead of visitors: https://xspeedcache.com/docs/preloader/
- Managing your fleet with xSpeed Hub: https://xspeedcache.com/docs/managing-your-fleet-with-xspeed-hub/
