Create Rank Math Redirection
Creates a redirection in Rank Math's Redirections module, active immediately unless status is "inactive". Each source is an address on this site (a path such as /old-page or a full URL on this domain) matched exactly, or a pattern matched with contains, start, end or regex. Types: 301 (moved permanently, the usual choice), 302 or 307 (temporary), 410 (deleted, no destination) and 451 (unavailable for legal reasons, no destination). Refused when a source is already handled by another redirection (mosmcp/rankmath-list-redirections shows them) or when the redirection would loop back to itself. Changes how the site answers those addresses for every visitor and search engine; undo it in Rank Math > Redirections. Browsers remember 301s, so test in a private window. Needs the Redirections module switched on.
Also known as: add redirect, 301 redirect, forward a URL, fix a broken link, moved page.
| Property | Value |
|---|---|
| Ability slug | mosmcp/rankmath-create-redirection |
| Wire tool name | mosmcp__rankmath-create-redirection |
| Category | Rank Math SEO (Pro) (mosmcp-rankmath) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | rank_math_redirections |
| Minimum default role | Administrator |
| Annotations | readOnly: false · destructive: false · idempotent: false · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| sources | object[] | Yes | — | The addresses to redirect, one or more. |
| sources[].url | string | Yes | — | The address or pattern to match: a path on this site such as /old-page, a full URL on this domain, or for regex a regular expression. |
| sources[].match | string (one of exact, contains, start, end, regex) |
exact |
How url is matched: "exact" (default), "contains", "start", "end" or "regex". | |
| sources[].ignore_case | boolean | false |
Match regardless of upper and lower case. Default false. | |
| destination | string | — | Where to send visitors: a full http(s) URL or a path on this site such as /new-page. Required for 301, 302 and 307; leave out for 410 and 451. | |
| type | integer (one of 301, 302, 307, 410, 451) |
301 |
The HTTP status: 301 permanent (default), 302 or 307 temporary, 410 content deleted, 451 unavailable for legal reasons. | |
| status | string (one of active, inactive) |
active |
"active" (default) to start redirecting now, or "inactive" to save it switched off. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| created | boolean | Yes | |
| redirection | object | Yes | |
| redirection.id | integer | Yes | |
| redirection.sources | object[] | Yes | |
| redirection.destination | string | Yes | Where it sends visitors; empty for 410 and 451. |
| redirection.type | integer | Yes | HTTP status: 301, 302, 307, 410 or 451. |
| redirection.type_label | string | ||
| redirection.status | string | Yes | active, inactive or trashed. |
| redirection.hits | integer | ||
| redirection.created | string | In the site's timezone. | |
| redirection.updated | string | ||
| redirection.last_accessed | string | Empty when never used. | |
| notes | string[] |
Example
Sample prompt
Redirect /old-pricing to /pricing with a permanent 301 in Rank Math.
Example request (json)
{
"jsonrpc": "2.0",
"id": 581,
"method": "tools/call",
"params": {
"name": "mosmcp__rankmath-create-redirection",
"arguments": {
"input": {
"sources": [
{
"url": "/old-pricing",
"match": "exact"
}
],
"destination": "/pricing",
"type": 301
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 581,
"result": {
"isError": false,
"structuredContent": {
"created": true,
"redirection": {
"id": 18,
"sources": [
{
"pattern": "old-pricing",
"match": "exact",
"ignore_case": false,
"url": "https://example.com/old-pricing"
}
],
"destination": "https://example.com/pricing",
"type": 301,
"type_label": "301 Permanent Move",
"status": "active",
"hits": 0,
"created": "2026-11-19 10:42:05",
"updated": "2026-11-19 10:42:05",
"last_accessed": ""
},
"notes": [
"It is active now. Browsers remember 301 redirects, so test it in a private window; to undo it, delete or deactivate it in Rank Math > Redirections."
]
}
}
}
Edge cases / errors
- A source that another live redirection already has → mosmcp_rankmath_redirection_duplicate; change that one in Rank Math > Redirections instead.
- A destination the sources match, or one already redirected back to them → mosmcp_rankmath_redirection_loop.
- 301, 302 or 307 without a destination → mosmcp_rankmath_redirection_destination_missing; 410 or 451 with one → mosmcp_rankmath_redirection_destination_unexpected.
- The home page or an address on another domain as an exact source → mosmcp_rankmath_redirection_source_invalid; a regex that does not compile → mosmcp_rankmath_redirection_regex_invalid.
| << Previous | Next >> |
|---|---|
| Apply Rank Math Schema Template | Get Rank Math SEO Score |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.