# Purge the WordPress cache with Claude

> Purging the WordPress cache with Claude means telling Claude in a chat which site changed, then letting it clear the xSpeed cache and warm it again through the xSpeed Hub connector you added.

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

This is the job you hand to a chat when you are away from your desk and a page is wrong. You fixed a typo in a post from your phone, or a client messages that the pricing page still shows last week's numbers. You open Claude and type what you saw: which site, which page, what looks stale. Claude calls list_sites to match the name you used, picks a purge type, and runs purge_cache through the connector. You never open wp-admin or a terminal.

Because this is a chat, the answer comes back as a plain summary. A page purge on one site returns how many stored pages were cleared. A purge of type all also reports the object cache and, where Cloudflare is connected in xSpeed, the edge. Claude can then offer to start the preloader so the next visitors are not the ones rebuilding the page, and if you ask for the cache status afterwards it reads the hit ratio back to you.

Claude can ask for approval before a connector tool runs, with Allow once or Always allow in the prompt, and under Customize > Connectors each tool is set to Always allow, Needs approval or Blocked. That setting is your main gate, because xSpeed Hub itself runs a write as soon as your connection allows writes. For a purge on every site, the Hub also tells Claude to say that it will touch all the sites and wait for your yes, but that is guidance to the model, not a lock.

## Set up Claude 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. Add xSpeed Hub as a custom connector

Go to Customize > Connectors and click Add custom connector. Name it xspeedhub and paste the URL. Under Authentication choose Sign in now, and if Claude asks how it identifies itself, choose Register automatically, which uses dynamic client registration. Click Add. On a Team or Enterprise plan an Owner does this under Organization settings > Connectors, with Add, then Custom, then Web.

```
https://app.xspeedcache.com/xspeed/mcp
```

### 3. Connect and turn it on in a chat

Click Connect on the xspeedhub connector and approve access on the xSpeed Hub page that opens. Then, in a conversation, click + in the message box, choose Connectors and switch xspeedhub on. Claude can use the connector only in conversations where that toggle is on.

```
+  >  Connectors  >  xspeedhub (on)
```

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

### 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. Claude can ask for your approval before it uses a connector tool. Allow once runs that call, and Always allow skips the prompt for that tool from then on. Under Customize > Connectors you can set each tool, or a group of tools, to Always allow, Needs approval or Blocked. xSpeed Hub has no confirmation step of its own, so a write tool you set to Always allow runs as soon as your connection allows writes. Keep purge_cache, update_settings, toggle_cache and the other write tools on Needs approval, block the ones you never want. For read-only access, sign in as a Viewer member of the workspace, or use the connection token with Read-only everywhere on, which needs the Request headers beta. The switch does not apply to a normal OAuth sign-in.

## Prompts

- The pricing page on shop still shows last week's price. Use xSpeed Hub to purge the page cache there and tell me what you cleared.
- I edited a post on blog from my phone. With xSpeed Hub, purge only the page cache, then warm it again.
- Ask xSpeed Hub to purge every site in my workspace and list any where it failed.

## Example session

```
You: I fixed a typo in a post on blog, but the old text still shows. Can you clear it with xSpeed Hub?
  → list_sites [read-only]: 6 sites; blog is blog.example.com
Agent: A content edit only needs the stored pages cleared. Purge the page cache on blog?
You: Yes.
  → purge_cache(site: blog, type: page) [changes site]: 212 cached pages cleared; assets and object cache left alone
Agent: Done. Reload the post and the new text should show. Want me to start the preloader so the pages rebuild before visitors arrive?
```

## 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 Claude

Choosing Always allow on purge_cache turns the prompt off for it, and from then on a purge runs the moment Claude decides to call it. Set the read tools to Always allow, keep purge_cache on Needs approval, and set any tool you never want called to Blocked. The connector signs in with OAuth and gets the scopes Claude requests, read and write by default, and the Hub's Read-only everywhere switch applies only to the connection token. For a chat that should only look, sign in as a Viewer member of the workspace. Anthropic notes that Research can call connector tools without further approval, so block purge_cache before you use Research with this connector. The connector also works only in a chat where you switched it on from the plus menu, and the Free plan allows one custom connector, so if it is missing, check both. On Team and Enterprise plans an Owner adds the connector for the organization.

## 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 I purge my WordPress cache from a Claude chat?

Yes. Once xSpeed Hub is added as a custom connector, you can tell Claude which site changed and it calls purge_cache with a type that fits, such as page after a post edit. It reports what was cleared, and you can ask it to start the preloader afterwards.

### Does Claude ask before it purges my site?

Claude can ask for approval before a connector tool runs, and you set each tool to Always allow, Needs approval or Blocked under Customize, then Connectors. xSpeed Hub has no confirmation of its own, so a purge_cache set to Always allow runs without a prompt. A sign-in as a Viewer member is read-only and refuses purges entirely.

### 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 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/) · [OpenClaw](https://xspeedcache.com/agent/openclaw/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 Claude

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