---
title: "Letting an AI Agent Edit WordPress Content Safely: Permissions, Staging, Rollback"
url: "https://wpimportexport.com/ai-agent-edit-wordpress-content-safely/"
description: "Let Claude Code or another AI agent edit WordPress safely: separate Application Passwords, staging first, an UpdraftPlus backup and a tested rollback."
type: post
published: 2026-11-05T20:42:20+00:00
modified: 2026-11-18T13:09:04+00:00
categories: ["AI", "Tutorials"]
tags: ["Abilities API", "AI Agents", "Claude", "Import Export by RockStarLab", "WordPress Bulk Update", "WordPress staging"]
docs_topics: ["Using with AI agents"]
---

# Letting an AI Agent Edit WordPress Content Safely: Permissions, Staging, Rollback

Letting an AI agent read your WordPress site is low risk. Letting it change content is different. An agent can write to many pages in a minute, and if it misreads the task, you need to undo that quickly.

The setup below was tested with Claude Code on a staging copy of a site. The agent writes Yoast meta descriptions for five pages. It makes an UpdraftPlus backup first, writes only the field it was asked to change, and checks the result. Then it rolls everything back from the backup. The setup has three parts:

- **Permissions:** what the agent can reach, and how you turn it off.
- **Staging:** where the agent runs first.
- **Rollback:** how you undo the change.

We used WordPress 7.1, MCP Adapter 0.7.1, UpdraftPlus 1.26.14, Yoast SEO and [Import Export by RockStarLab](https://wordpress.org/plugins/import-export-by-rockstarlab/) 2.1.19. The approach also works with Cursor, Codex and GitHub Copilot.

## The Short Version

1. Connect the agent with its own Application Password, one per tool.
2. Turn on agent access in the plugin only when you need it.
3. Run the task on staging first.
4. Make the agent create a backup and wait until UpdraftPlus confirms it before it writes anything.
5. Make it change content only through a validated import in update mode, matched by ID.
6. Make it read back every page it changed.
7. If the result is wrong, have it prepare a restore plan, read the warning, and only then confirm.

## Permissions: What the Agent Can Do

### The account and the Application Password

The agent signs in to WordPress with a username and an [Application Password](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#basic-authentication-with-application-passwords). Everything it does runs with that user’s rights. Import Export by RockStarLab only runs its actions for administrators, that is, users with the `manage_options` capability. An editor’s password can still list the actions, but every call returns “You do not have permission to use the plugin API.”

The agent therefore uses an administrator account, so limit the access in other ways:

- **Create one Application Password per tool**, named after the tool: “Claude Code”, “Cursor” and so on. In the table you can see when each one was last used and from which IP, and you can revoke one tool without breaking the others.
- **Consider a separate administrator user for agents**, for example `ai-agent`. Its access is then separate from your own account, and you can cut off all agents in one step by revoking its passwords or deleting the user.
- **Never give the agent your login password.** It does not work for the REST API anyway. Application Passwords cannot be used to log in to wp-admin.

![WordPress profile Application Passwords table with a password named Claude Code, its last used date, last IP and a Revoke button](https://wpimportexport.com/wp-content/uploads/2026/11/02-application-passwords-per-tool.webp)

_Give each tool its own Application Password. Last Used shows activity, and Revoke cuts off one tool without touching the others._

### The plugin’s access switches

Two switches in **Import Export → AI Agent Connection** control what the agent can reach:

- **Enable Abilities API.** When it is off, the agent cannot see or run any of the plugin’s export, import, sync or backup actions. It is off by default. Turning it off does not stop jobs that are already running.
- **Enable Abilities API for UpdraftPlus.** This separate switch lets the agent list backups, create backups, check their progress and restore a backup. A restore always needs a checked plan and your explicit confirmation.

![Import Export by RockStarLab AI Agent Access card with the Enable Abilities API switch turned on and logos of Codex, Claude Code, Cursor, GitHub Copilot and Gemini CLI](https://wpimportexport.com/wp-content/uploads/2026/11/01-abilities-api-switch.webp)

_One switch decides whether agents can use the plugin's actions at all. It is off by default._

\

![Backup and Recovery card with the Enable Abilities API for UpdraftPlus switch turned on and a note that restoring requires a checked plan and explicit confirmation](https://wpimportexport.com/wp-content/uploads/2026/11/03-updraftplus-agent-access.webp)

_Backup access is a separate switch. Restores always need a checked plan and your confirmation._

If you only want the agent to audit content, for example to [export Yoast titles and meta descriptions to a CSV](https://wpimportexport.com/how-to-export-yoast-seo-titles-and-meta-descriptions-to-csv-for-an-seo-audit/), leave backup access off.

### Permissions in the agent itself

The agent has its own permission settings, and they matter because it can also run shell commands on your computer. With the WordPress MCP Adapter there is one detail to know: every plugin action goes through a single MCP tool, `mcp-adapter-execute-ability`. Reading a page and starting an import look the same to the agent’s permission system. Only the `ability_name` inside the call is different.

This is the project settings file we used in Claude Code, `.claude/settings.json`:

```
{
  "permissions": {
    "allow": [
      "mcp__wordpress__mcp-adapter-discover-abilities",
      "mcp__wordpress__mcp-adapter-get-ability-info"
    ],
    "ask": [
      "mcp__wordpress__mcp-adapter-execute-ability"
    ]
  }
}
```

Listing actions and reading their descriptions is allowed. Every execution asks first, so in an interactive session you read the `ability_name`, for example `rsl-ie/export-preview` or `rsl-ie/import-start`, before you approve. Note that in non-interactive mode (`claude -p`) nobody can answer the question, so “ask” calls are refused: “Claude requested permissions to use mcp__wordpress__mcp-adapter-execute-ability, but you haven’t granted it yet.” For scripted runs, allow the tool explicitly and put the limits in the prompt and on the WordPress side.

Keep shell access narrow too. With all shell access turned off, the agent had no way to encode the CSV for upload. The upload action takes the file as base64 text, and the agent refused to encode about 1,000 characters by hand because a single wrong character would corrupt the data. We allowed only file writes in the working folder and two commands:

```
claude --allowedTools "mcp__wordpress__*" "Write" "Bash(base64:*)" "Bash(wc:*)"
```

The connection itself is described in [How to Connect Claude Code to WordPress via MCP](https://wpimportexport.com/connect-claude-code-to-wordpress-mcp/). If the agent cannot connect, see [WordPress MCP Adapter errors](https://wpimportexport.com/wordpress-mcp-adapter-errors/).

## Staging: Where the Agent Runs First

Point the agent at a staging copy first, not at the live site. A staging copy is a private clone of the site, usually on the same host or in LocalWP. Use a separate connection for it with its own name, so the agent cannot mix up the two sites. If you do not have a fresh copy, [refresh staging with live content](https://wpimportexport.com/how-to-refresh-staging-with-live-content-without-overwriting-your-work/) before the test.

On staging you find out how the agent reads the task, which actions it chooses and how long the job takes. In our test it took the agent two minutes and 35 steps to back up the database, upload the file, validate the import, run it and check the result. When the result is right, repeat the same prompt on the live site. Live needs its own backup, because a backup of staging cannot restore live. Alternatively, move the checked content with [a push from staging to live that does not overwrite the database](https://wpimportexport.com/how-to-push-wordpress-staging-to-live-without-overwriting-the-database/).

## A Safe Change, Step by Step

Our test site had five published pages without a Yoast meta description. First we asked the agent only for a plan:

```
Using the MCP server named wordpress: check the UpdraftPlus status and list the existing backups. Then find published pages that have no Yoast meta description and propose a meta description of 140 to 155 characters for each one, based on the page content. Do not change anything yet, just show me the plan.
```

The agent checked UpdraftPlus and found the five pages. It proposed descriptions of 142 to 149 characters and changed nothing. It also noted that the test pages contained placeholder text, so it based the descriptions on page titles. That is the kind of remark you want to see before any write. Then we gave it the write task with explicit rules:

```
Update the Yoast meta descriptions of five pages on this site. Rules:
1. First create an UpdraftPlus backup of the database and wait until UpdraftPlus confirms it is complete. Do not write anything before that.
2. Write only the _yoast_wpseo_metadesc field, using the plugin's import in update mode matched by page ID. Change nothing else.
3. Validate the import before you start it.
4. When it is done, read the five pages back and confirm the descriptions, status and author.

1007: Find the perfect coffee gift this season - curated bundles, ...
(one line per page)
```

What the agent did:

1. **Backup.** It called `rsl-ie/updraftplus-backup-start` with the database only and polled `updraftplus-backup-status` until UpdraftPlus confirmed “successful backup completion”. The backup was ready in about six seconds.
2. **File.** It wrote a two-column CSV, `ID,_yoast_wpseo_metadesc`, and uploaded it with `upload-create`, `upload-chunk` and `upload-complete`. The upload returned the parsed headers and preview rows, so the agent could check the content before the import.
3. **Validation.** `import-validate` with `duplicate_check: ID` and `duplicate_mode: update` returned `valid: true` for 5 items. Nothing was written at this step.
4. **Import.** `import-start` queued job 18. The job finished with 5 processed, 5 updated, 0 failed.
5. **Read-back.** `export-preview` for the five IDs showed the new descriptions. Status and author were the same as before.

![Claude Code terminal: UpdraftPlus database backup completed, CSV uploaded, import validated and run in update mode by ID, then a read-back table showing five pages still published with the same authors](https://wpimportexport.com/wp-content/uploads/2026/11/04-agent-backup-then-import.webp)

_Backup first, then a validated update by ID, then a read-back of every page it touched._

Two things make this safe. Update mode matched by ID can only change pages that already exist, and only the mapped columns. Columns that are not in the file, such as title, status, author, slug or content, keep their values. The only side effect is the normal one for any edit: WordPress records a new modified date for each updated page.

The same pattern works for any bulk edit: export the affected rows, change them in a spreadsheet or let the agent change them, then import in update mode. See [how to bulk update existing posts without creating duplicates](https://wpimportexport.com/how-to-bulk-update-existing-wordpress-posts-without-creating-duplicates/).

## Back Up Before Every Change

This step is not optional. Whether you edit by hand, with an import or through an agent, make a backup first. In UpdraftPlus click **Backup Now**, or let the agent do it with `rsl-ie/updraftplus-backup-start` and wait for `rsl-ie/updraftplus-backup-status` to report completion. Backups started by the agent are normal UpdraftPlus backups and appear under **Existing backups** in the dashboard. You can restore them there without the agent, too. For the full backup and restore workflow, see [How to Create a WordPress Website Backup and Restore It](https://wpimportexport.com/how-to-create-a-wordpress-website-backup-and-restore-it/).

![UpdraftPlus Existing backups list with several database backups created by the AI agent](https://wpimportexport.com/wp-content/uploads/2026/11/05-updraftplus-existing-backups.webp)

_Backups the agent creates are normal UpdraftPlus backups and appear in the dashboard._

Backup and restore jobs run through WP-Cron. The response says so: “A working WP-Cron or system cron runner is required.” If the backup stays queued, check that cron works on the site.

## Rollback: Undo the Change

Suppose the client rejects the new descriptions. We asked the agent for a restore plan, not a restore:

```
The client changed their mind. Roll back: restore the database from the backup you made before the import. Prepare the restore plan and show me what it will restore and the warning. Do not start the restore until I confirm.
```

The agent listed the backups and found the database backup made just before the import. It called `rsl-ie/updraftplus-restore-plan`. The plan checks that the archive exists on the server and returns a plan ID, a confirmation token, the selected components and a warning from UpdraftPlus. The plan expires after a short time. The agent showed the warning word for word and said the restore had not started.

![Claude Code showing an UpdraftPlus restore plan for a database-only backup with the warning that newer data may be lost, and stating the restore has not started](https://wpimportexport.com/wp-content/uploads/2026/11/06-restore-plan-warning.webp)

_The agent prepares a restore plan, shows the warning and waits._

Read the warning before you confirm. A database restore brings back the whole database as it was at backup time, not just the five fields. Any other change made since then, such as a new order, comment or edit, is lost too. That is why the backup should be made right before the change, and why the rollback should happen soon after.

After “Confirmed”, the agent called `rsl-ie/updraftplus-restore-start` with the plan ID, the token and `confirm: true`. A restore cannot start without the plan and the token. During the restore, one status call got HTTP 503 “Briefly unavailable for scheduled maintenance”. That is normal, because WordPress is in maintenance mode while the database is replaced. The agent waited, asked again and got “UpdraftPlus confirmed restore and cleanup completed.” The read-back showed all five descriptions empty again. The restore took about six seconds on our test site.

![Claude Code starting the confirmed restore, getting a temporary 503 maintenance response, then UpdraftPlus confirming the restore and a table showing the five meta descriptions empty again](https://wpimportexport.com/wp-content/uploads/2026/11/07-restore-and-read-back.webp)

_After confirmation the restore runs. A short 503 during the restore is normal._

### When a full restore is too much

On a busy live site, restoring the whole database to undo five fields may cost you newer orders or comments. For a targeted rollback, ask the agent to export the fields it is about to change to a CSV before the change, for example ID and `_yoast_wpseo_metadesc`. To undo, import that file in update mode by ID. Only those fields go back, and everything else stays as it is. Keep the UpdraftPlus backup as the safety net in any case. For all three rollback methods with screenshots, see [How to Roll Back a Bad WordPress Import or Sync](https://wpimportexport.com/roll-back-bad-wordpress-import/).

## Rules to Put in Every Prompt

Agents follow explicit rules better than general requests. These lines worked in our tests:

- “Do not change anything yet, just show me the plan.”
- “First create an UpdraftPlus backup and wait until UpdraftPlus confirms it is complete. Do not write anything before that.”
- “Use the plugin’s import in update mode, matched by ID. Change nothing else.”
- “Validate the import before you start it.”
- “Read every changed page back and confirm the values.”
- “Prepare the restore plan and show me the warning. Do not start the restore until I confirm.”

When you are done, turn off agent access or revoke the Application Password if you do not need it again soon.

## FAQ

### Can the agent restore a backup without asking me?

Not through the plugin. A restore needs a plan created first and a confirmation token from that plan, and the action description tells the agent to show you the warning and ask. You can also leave the UpdraftPlus switch off, and then the agent cannot restore anything.

### Can I give the agent an editor account instead of an administrator?

The agent can connect, but the plugin’s actions return “You do not have permission to use the plugin API.” Imports, exports and backups need an administrator. Limit access with a dedicated user, one password per tool, and the access switches.

### Does the agent see my Application Password?

The password is stored in the agent’s MCP configuration on your computer and is sent with each request. Treat that configuration like any other credential, and revoke the password in your WordPress profile when a tool is no longer used.

### Do I need UpdraftPlus?

The plugin’s backup actions use UpdraftPlus. If you use another backup tool, make the backup there before the agent starts, and tell the agent in the prompt that it exists.

### Which agents does this work with?

Any agent that connects through the WordPress MCP Adapter. We have guides for [Claude Code](https://wpimportexport.com/connect-claude-code-to-wordpress-mcp/), [Cursor](https://wpimportexport.com/connect-cursor-to-wordpress-mcp/), [Codex](https://wpimportexport.com/connect-codex-to-wordpress-mcp/) and [GitHub Copilot](https://wpimportexport.com/connect-github-copilot-to-wordpress-mcp/). Their permission settings differ, but the WordPress side is the same.

## Related Guides

- [How to Export WordPress Content to JSON for AI and LLMs](https://wpimportexport.com/export-wordpress-content-json-for-ai/)
- [How to Roll Back a Bad WordPress Import or Sync](https://wpimportexport.com/roll-back-bad-wordpress-import/)
- [How to Use the WordPress Abilities API with AI Agents](https://wpimportexport.com/how-to-use-the-wordpress-abilities-api-with-ai-agents-exports-imports-content-sync-and-backups/)
- [How to Connect Claude Code to WordPress via MCP](https://wpimportexport.com/connect-claude-code-to-wordpress-mcp/)
- [WordPress MCP Adapter Errors: Fix 401, 404 and Application Password Problems](https://wpimportexport.com/wordpress-mcp-adapter-errors/)
- [How to Create a WordPress Website Backup and Restore It](https://wpimportexport.com/how-to-create-a-wordpress-website-backup-and-restore-it/)
- [How to Bulk Update Existing WordPress Posts Without Creating Duplicates](https://wpimportexport.com/how-to-bulk-update-existing-wordpress-posts-without-creating-duplicates/)
