# Tune WordPress cache settings with OpenClaw

> Tuning cache settings with OpenClaw means asking your always-on agent to compare xSpeed cache settings across your WordPress sites, report where they differ, and write a correction through xSpeed Hub once you agree.

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

You run OpenClaw as an agent that is always on, and you have a standard for your sites: pages cached for a day, the checkout and cart excluded. Sites drift from a standard. A plugin update or a late-night edit changes a value, and nobody notices until pages go stale. You ask OpenClaw to compare the cache module on every site with shop, the one you trust. It calls list_sites, then get_settings on each, and lists the sites whose expiry or exclusions differ.

What comes back is a drift report in the chat you use with it, one line per site, with the value that differs and the value it should have. Nothing is written yet. When you answer with the sites you want fixed, OpenClaw calls update_settings, and the Hub tells it to briefly confirm intent first. For more than one site it sends one call with a list of handles or site: "all", and the Hub tells it to say this will touch all N sites. You get a stored result for each site.

What differs in OpenClaw is that it has a built-in scheduler, called automations, so you can have the comparison run every morning without you typing it. A scheduled run in a fresh session is unattended, with nobody to approve a call. Give the job a --tools list that names only xspeedhub__list_sites and xspeedhub__get_settings, so no write tool exists for it, and make the write a reply from you. The Hub has no scheduler for agent prompts, so the timer is OpenClaw's.

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

- Use xSpeed Hub to compare the cache expiry and exclusions on every site with shop and list the sites that differ. Do not change anything.
- With xSpeed Hub, read the cache settings on all sites every morning and tell me if any site no longer has the checkout excluded.
- Using xSpeed Hub, fix the drift on blog and docs only: set their cache expiry to match shop, and show me the result for each.

## Example session

```
You: Use xSpeed Hub to compare the cache settings on every site with shop and tell me which have drifted.
  → list_sites [read-only]: 6 sites: shop, blog, docs, academy, partners, careers
  → get_settings(site: shop, module: cache) [read-only]: cache expiry 24 hours; checkout and cart excluded
  → get_settings(site: blog, module: cache) [read-only]: cache expiry 6 hours; checkout and cart excluded
  → get_settings(site: docs, module: cache) [read-only]: cache expiry 24 hours; checkout and cart excluded
  → get_settings(site: academy, module: cache) [read-only]: cache expiry 24 hours; checkout and cart excluded
  → get_settings(site: partners, module: cache) [read-only]: cache expiry 24 hours; checkout and cart excluded
  → get_settings(site: careers, module: cache) [read-only]: cache expiry 24 hours; checkout and cart excluded
Agent: blog is at 6 hours where shop is at 24, and its exclusions match. docs, academy, partners and careers all match shop. I would set blog to 24 and change nothing else. Apply it to blog?
You: Yes, just blog.
  → update_settings(site: blog, module: cache, values: { cache_expiry: 24 }) [changes site]: stored, cache expiry now 24 hours
Agent: blog now matches shop. I will keep reporting drift each morning and leave the changes to you.
```

## How it works

1. **List the modules**: list_modules returns every Free and Pro module available on one site, with its settings schema and status. It tells the agent which module slugs exist, such as minify or gzip, and what each setting accepts.
2. **Read the current settings**: get_settings takes a module slug and returns its settings. Credential fields come back masked, so an agent cannot read a stored API token or password back in plain text.
3. **Change them**: update_settings takes the module and a values object of setting keys. The site checks the whole object first. If any key is unknown, any value is outside the schema, or a field is pinned by a constant in wp-config.php, it refuses the write, writes nothing and says which keys and why, sometimes with a "did you mean" hint.
4. **Turn page caching on or off**: Page caching has its own tool, toggle_cache, because it installs or removes the cache drop-in and the WP_CACHE constant. Asking update_settings to set cache_enabled does not work and is refused. If another caching plugin owns the drop-in, the site declines to enable xSpeed and returns blocked: true with the reason.
5. **Check the effect**: The result of a settings write is the stored settings. A module can add a warning when a setting is saved but has no effect on this server, for example Brotli on a server without the module for it, and the agent should pass that on. run_benchmark then times cached against uncached to see whether the change helped.
6. **Apply to many sites only after reading one**: update_settings and toggle_cache accept site: "all" or a list of handles. Each site validates against its own schema and answers in its own row, so a module missing on one site fails that row and the others still apply. Read one site first, then apply.

## Reference

| | |
| --- | --- |
| Discover | list_modules (read): Free and Pro modules, settings schema, status, per site |
| Read settings | get_settings (read): argument module; credential fields masked |
| Change settings | update_settings (write): arguments module and values; validated by the site |
| Bad input | The whole write is refused and nothing is written; the error names the keys and reasons |
| Page cache on or off | toggle_cache (write): argument enabled; cache_enabled in update_settings is refused |
| Blocked by another plugin | toggle_cache returns blocked: true with blocked_reason when another plugin owns the cache drop-in |
| Every site at once | update_settings and toggle_cache accept site: "all" or a list of handles, one result per site |
| Pro modules | A Pro module on a site without an active licence cannot be read or written; the site refuses |
| Credential fields | Refused by default over MCP; set them in the xSpeed dashboard, not through the agent |
| Read-only connection | The connection token with Read-only everywhere on, or a Viewer member's sign-in: update_settings and toggle_cache are refused; list_modules and get_settings still work. An OAuth sign-in gets the scopes the client asks for, read and write by default, clamped to the member's role |
| Confirmation | None on the Hub; the Hub tells the agent to briefly confirm intent for these two, and your client's prompt is the gate |

## Rules

- Read before you write. Ask for list_modules and get_settings first, so the agent changes real keys with valid values instead of guessing.
- update_settings and toggle_cache change how a live site behaves. They run as soon as your connection allows writes. The Hub tells the agent to briefly confirm intent first, which is guidance to the agent, so your client's approval prompt and a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) are the gates. The switch does not limit an OAuth sign-in.
- For site: "all", the Hub tells the agent to confirm once with "this will touch all N sites", then make one call. The result is per site, and some sites failing is a partial result to report, not a blanket success or failure.
- Do not ask an agent to set credentials such as a Cloudflare token or Redis password. The site refuses those writes by default, and they belong in the xSpeed dashboard.
- If a settings result says a value is saved but inactive on this server, relay that. Do not tell the user the feature is enabled.

## Good to know with OpenClaw

An automation in OpenClaw runs without you watching, so whatever write tools its job can reach will run when the model decides to use them. Give the scheduled job a --tools list of read tools, or a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in), and let it report drift, then apply fixes yourself in a reply. For chat turns, the gates are the tool filter from openclaw mcp tools and, when the Codex runtime runs your turns, a server set to prompt. The default full-permission posture does not prompt, and Allow Always saves a grant for that one tool with any arguments.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Use xSpeed Hub to list the modules on shop and tell me which ones are off.
- Ask xSpeed Hub for the current minify settings on blog.
- With xSpeed Hub, turn on HTML minification on blog, then benchmark the cache and tell me if it helped.
- Use xSpeed Hub to turn page caching off on staging while I debug, and tell me when it is off.
- Using xSpeed Hub, read the gzip settings on shop first, then enable the same options on every site.
- Use xSpeed Hub to set the page cache lifespan on docs to 30 days, and if the site refuses it, tell me why.

## Frequently asked questions

### Can OpenClaw fix cache setting drift by itself every night?

It can if its connection allows writes and the job's tool list includes update_settings, but the Hub has no confirmation of its own and no scheduler for agent prompts, so an unattended write has nobody to read it. Keep the nightly job to the read tools, have it report, and apply the fix when you reply.

### How does OpenClaw know which site is the reference?

You tell it. Name the site whose settings are the standard, and it reads that site with get_settings and compares every other site against it. It does not infer a standard on its own, so a wrong choice of reference gives you the wrong drift list.

### How does an agent know which settings exist?

It calls list_modules for the site, which returns every available module with its settings schema and status, then get_settings for the one module it wants to change. The schema says which keys exist and what values each accepts.

### What happens if the agent sends a wrong setting key?

The site refuses the whole update and writes nothing. The error names the keys it rejected and why, such as an unknown key, a value outside the allowed range, or a field fixed by a constant in wp-config.php, and it can suggest the nearest valid key.

### How do I turn page caching on or off with an agent?

Use toggle_cache with enabled set to true or false. It installs or removes the cache drop-in and the WP_CACHE constant. Setting cache_enabled through update_settings does not work. If another caching plugin already owns the drop-in, the site will not enable xSpeed and says why.

### Can one prompt change settings on all of my sites?

Yes. update_settings and toggle_cache accept site: "all", and the Hub runs the sites one after another with a one-second pause and returns a result per site. Each site checks the values against its own schema, so a site that lacks the module fails its own row while the others apply.

### Can the agent change my Cloudflare or Redis credentials?

Not by default. Writing credential fields over MCP is off unless the site owner allows it, and the site refuses the write and names the fields. Set credentials in the xSpeed dashboard. Credential values also come back masked when an agent reads settings.

## Tune cache settings with other agents

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

## More with OpenClaw

- [Purge the WordPress cache with OpenClaw](https://xspeedcache.com/agent/openclaw/purge-cache/)
- [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/)
- [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 minify CSS and JavaScript: https://xspeedcache.com/docs/minify/
- How to add cache rules and bypasses: https://xspeedcache.com/docs/rules-and-bypass/
- Site MCP tool reference: https://xspeedcache.com/docs/mcp-tool-reference/
