Skip to main content
Glama

Refresh permalinks

wp_flush_rewrite_rules
Destructive

Regenerate WordPress permalink rules to fix 404 errors after changing posts, custom post types, or taxonomies. Soft flush leaves .htaccess and permalink structure untouched.

Instructions

Regenerate the permalink (rewrite) rules stored in the database; it helps when posts, custom post types or taxonomies answer 404 after a structural change. A soft flush: the .htaccess file is not rewritten, and the permalink structure itself stays as set (Settings › Permalinks). Returns flushed=true. Requires manage_options.

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.10.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing what is and isn't touched: .htaccess is not rewritten and the permalink structure in Settings stays as configured. It also names the return value (flushed=true) and the required capability (manage_options), which the annotations do not convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences: purpose and trigger first, then the soft-flush caveats, then return value and capability. No filler and nothing buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although there is no output schema, the description supplies the response shape (flushed=true) plus the permission prerequisite and the mutation's limits. Everything an agent needs to decide to call it and interpret the result is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the schema needs no elaboration and the description correctly spends no words on inputs. Baseline 4 applies; no parameter-level value could be added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Regenerate the permalink (rewrite) rules stored in the database') and immediately scopes it as a soft flush. An agent can distinguish it from cache-clearing siblings like wp_clear_cache or wp_cleanup_transients based on the permalink/rewrite-rule focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete trigger condition: use when posts, custom post types, or taxonomies return 404 after a structural change. What's missing is explicit routing to alternatives (e.g., wp_cleanup_transients when stale transients, not permalinks, are the cause) — no sibling is named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools