---
title: "corestack_site_rewrite_urls_restore"
url: https://docs.corefinity.com/mcp/tools/corestack_site_rewrite_urls_restore
type: tool
last_updated: 2026-11-13
feature: migrate
related:
  - https://docs.corefinity.com/guides/migrate/migrate-wordpress.md
---
# corestack_site_rewrite_urls_restore

**Put back the addresses a rewrite saved.** Put back the addresses the newest corestack_site_rewrite_urls on this row saved. WordPress content returns to the first source host (several source hosts collapse into one), with home and siteurl exactly as they were; Magento 2 base URLs and the env.php locks, and Laravel APP_URL, return exactly. Refused nothing_saved when there is no rewrite left to reverse. On Magento, run it before attaching the domain on a multi-store, and before the cutover's switch whenever env.php locks base URLs. Scope: write. Also needs destructive when the target is production. Long-running: answers with a task.

- Scope: `write`
- Also needs `destructive` when the row is production; D12, P3
- Confirmation: `confirm_domain`
- Runs as a task: yes

## When to use it

Put back the addresses the newest corestack_site_rewrite_urls on this row saved. WordPress content returns to the first source host (several source hosts collapse into one), with home and siteurl exactly as they were; Magento 2 base URLs and the env.php locks, and Laravel APP_URL, return exactly. Refused nothing_saved when there is no rewrite left to reverse. On Magento, run it before attaching the domain on a multi-store, and before the cutover's switch whenever env.php locks base URLs.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `confirm_domain` (string, up to 253 characters): On the production row only: the site's domain, typed exactly.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_domain": {
      "description": "On the production row only: the site's domain, typed exactly.",
      "maxLength": 253,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `nothing_saved`: a URL-rewrite restore with no saved original URLs; nothing to restore.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_site_rewrite_urls_restore",
  "arguments": {
    "site_id": 4211
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_site_rewrite_urls_restore with site_id 4211. (Put back the addresses a rewrite saved.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [Migrate WordPress](https://docs.corefinity.com/guides/migrate/migrate-wordpress.md)
