# wordpress-api-pro

Adopt this skill: https://proskills.md/skills/other/digitizers-wordpress-api-pro-wordpress-api-pro

Page: https://proskills.md/skills/other/digitizers-wordpress-api-pro-wordpress-api-pro
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: wordpress-api-pro/SKILL.md
size: 8012
upstream: https://github.com/digitizers/wordpress-api-pro/blob/main/wordpress-api-pro/SKILL.md

````text
---
name: wordpress-api-pro
version: 3.9.5
license: MIT-0
description: |
  Production-grade WordPress REST API integration for managing posts, pages, media, WooCommerce products, Elementor content, SEO meta, ACF, and JetEngine fields.
  Use when you need to retrieve, draft, create, or update WordPress content programmatically on sites where the user has provided explicit credentials.
  For any operation that writes to a live site, get explicit user approval for the target site, post/product IDs, and final action before executing.
  Prefer drafts first. Run batch operations in dry-run mode first; use --execute only after review. Remote URL media downloads and local file reads are restricted by safety boundaries.
  Also includes a no-auth Tier-1 site audit (PageSpeed, SSL, security headers, CMS/PHP fingerprint, SEO basics) for cold pre-sale checks, and authenticated plugin/SEO-stack discovery.
permissions:
  env:
    - "WP_URL / WP_SITE_URL, WP_USERNAME / WP_USER, WP_APP_PASSWORD (auth)"
    - "WP_CONFIG (optional sites.json path), WP_ALLOWED_FILE_ROOTS (file-read scope)"
    - "WP_ALLOW_REMOTE_URLS, WP_REQUIRE_HTTPS, WP_REQUIRE_ALLOWLIST, PAGESPEED_API_KEY"
    - "WP_ALLOW_HTTP (comma-separated HOST LIST, never a blanket value), WP_ALLOW_RAW_META"
    - "WP_ALLOW_PROXY (use a configured HTTP(S) proxy for audit/media fetches; off by default because the proxy, not this skill, then decides what it connects to — with it on, URLs and redirect targets are still validated but addresses are not)"
  network:
    - "Outbound HTTPS to the configured WordPress site(s) /wp-json/ REST API — plaintext http:// to a non-local host is refused unless that exact host is named in WP_ALLOW_HTTP"
    - "https://www.googleapis.com/pagespeedonline (site_audit only)"
    - "site_audit reaches the audited site over http:// or https://; every address it connects to, redirects included, must be globally reachable (is_global) and none of loopback, private, link-local, multicast, reserved or unspecified — CGNAT/shared address space (100.64.0.0/10) is refused too. The validated address is the one dialled, so a name cannot resolve differently between the check and the connection; TLS is still verified against the hostname. HTTP(S)_PROXY is ignored for these fetches unless WP_ALLOW_PROXY=1, since a proxy resolves the target itself. Response bodies are capped at 5 MB"
  filesystem:
    - "Read-only, scoped to WP_ALLOWED_FILE_ROOTS (default: cwd)"
  shell: "wp_cli.py spawns python3 <script> subprocesses (subprocess.run with an argv list; no shell interpreter, never shell=True). wp.sh is a bash wrapper around it."
---

# WordPress API Pro

Manage WordPress sites through the REST API. Runs as an OpenClaw skill or in Claude Code.

## Running in Claude Code

This skill runs the `scripts/*.py` directly, from wherever the skill is installed
(`~/.claude/plugins/` for a plugin install, `~/.claude/skills/wordpress-api-pro/`
for the repo's `bash INSTALL.sh` — that installer lives in the git repo, not in
the packaged skill):

- **Auth:** export `WP_URL` / `WP_USERNAME` / `WP_APP_PASSWORD`, or use `config/sites.json` for multi-site.
- **Dependencies:** the ACF / SEO / JetEngine / plugin-detection scripts need `requests` (`python3 -m pip install -r requirements.txt`, ideally in a venv). The pin is a RANGE, `requests>=2.32.3,<3`, not an exact version or a hash lock. That is deliberate: an exact pin stops users receiving patch-level security fixes for the dependency whose advisory is the reason for the lower bound, and this skill has no lockfile-refresh process to compensate. The trade is reproducibility for patchability.
   2.32.0 fixed CVE-2024-35195, where a `Session` that made one `verify=False` request silently skipped certificate verification for every later request to that host, and 2.32.3 closes out that line's follow-up regressions. The core post/page/media/WooCommerce/batch scripts use the stdlib only.
- **Local dev sites** (e.g. `http://site.local`, `localhost`, `*.test`, `*.localhost`) work over plaintext http. Any other host must be https:// unless you name it: `WP_ALLOW_HTTP=staging.example.com` (comma-separated for several). A blanket `WP_ALLOW_HTTP=1` is refused — it used to permit every host, so one variable set for one staging box covered production too.
- **Pairs with the Elementor MCP kit** (`siteagent-elementor-studio`): build page structure with the MCP, then do media uploads, SEO meta, custom fields, and WooCommerce here.

## Safety rules

- **Never publish or update live content without explicit user approval.** Confirm target site, IDs, fields, and status.
- **Use least-privilege credentials.** Prefer a dedicated WordPress user/application password scoped to the required role.
- **Do not store production credentials in the repo.** Use environment variables when possible.
- **Protect config files.** If you create `config/sites.json`, keep it local, untracked, and `chmod 600 config/sites.json`.
- **Batch changes are dry-run by default.** Add `--execute` only after reviewing the dry-run output.
- **A created WooCommerce product is a draft.** WooCommerce publishes a product whose status is omitted; `woo_products.py --action create` sends `draft` unless you pass `--status publish`, and prompts at a TTY before a live one (`--yes` skips, non-interactive runs are never prompted).
- **Targeting every site is blocked by default.** Add `--allow-all` only when the user explicitly approved all configured sites.
- **Local file reads are restricted.** `--content-file` and media uploads can read only from the current working directory by default. Set `WP_ALLOWED_FILE_ROOTS` to opt into another safe directory.
- **Remote media URLs are opt-in.** `upload_media.py` requires `--allow-remote-url` or `WP_ALLOW_REMOTE_URLS=1`, allows HTTPS only, and blocks private/local network hosts.
- **Raw SEO meta keys are refused by default.** `seo_meta.py` writes only keys in the Rank Math / Yoast allowlist; anything else fails, because a typo'd friendly name would otherwise create a junk postmeta row or overwrite a key another plugin owns. Set `WP_ALLOW_RAW_META=1` to write raw keys with a warning. ACF/JetEngine custom-field keys are unaffected — arbitrary keys are their intended API.
- **Interactive publish confirmation on TTY.** `create_post.py` and `update_post.py` prompt for confirmation before `--status publish` when run interactively. Pass `--yes` / `-y` to bypass. Non-interactive/agent runs are unchanged.

## Authentication

Recommended environment variables:

```bash
export WP_URL="https://example.com"
export WP_USERNAME="wp-api-user"
read -rs WP_APP_PASSWORD
export WP_APP_PASSWORD
```

Application Password setup:
1. Open `https://your-site.example/wp-admin/profile.php`.
2. Create a new Application Password for a dedicated API user.
3. Copy it once and store it in a secret manager or environment variable.
4. Rotate/revoke it when no longer needed.

## Quick start

### Read/list posts

```bash
python3 scripts/get_post.py --post-id 123
python3 scripts/list_posts.py --per-page 10 --status publish
```

### Create a draft

```bash
python3 scripts/create_post.py \
  --title "Draft title" \
  --content "Draft content" \
  --status draft
```

### Update a post after approval

```bash
python3 scripts/update_post.py \
  --post-id 123 \
  --title "Approved title" \
  --content "Approved content" \
  --status draft
```

### Read content from a local file safely

By default the file must be under the current working directory:

```bash
python3 scripts/update_post.py \
  --post-id 123 \
  --content-file ./content/post-123.html \
  --status draft
```

To opt into another safe folder:

```bash
export WP_ALLOWED_FILE_ROOTS="/absolute/path/to/approved-content"
python3 scripts/update_post.py --post-id 123 --content-file /absolute/path/to/approved-content/post.html
```

## Multi-site configuration

Copy the template locally:

```bash
cp config/sites.example.json config/sites.json
chmod 600 config/sites.json
```

Use a 
````

## File: README.md
upstream: https://github.com/digitizers/wordpress-api-pro/blob/main/README.md

````text
# WordPress API Pro — Claude Code & OpenClaw Skill

[![CI](https://github.com/Digitizers/wordpress-api-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/Digitizers/wordpress-api-pro/actions/workflows/ci.yml)
![Claude Code Skill](https://img.shields.io/badge/Claude_Code-Skill-d97757)
![OpenClaw Skill](https://img.shields.io/badge/OpenClaw-Skill-purple)
![WordPress](https://img.shields.io/badge/WordPress-REST_API-21759b)
![License: MIT--0](https://img.shields.io/badge/License-MIT--0-green)
![Version](https://img.shields.io/badge/version-3.9.5-blue)

A production-grade **Claude Code & OpenClaw skill** for managing WordPress content via the REST API — posts, pages, media, WooCommerce, Elementor, SEO meta, ACF, JetEngine — with explicit safety boundaries for agentic use.

This is not just a tool reference. It is an operational playbook for managing WordPress content responsibly: posts, pages, media, WooCommerce products, Elementor content, SEO metadata, and custom fields — with drafts-first, dry-run, and explicit-approval guardrails on every write.

## Part of the Aura Design Engine

These are the free skills behind [**Aura**](https://my-aura.app) — one AI web-agency lifecycle you can run standalone or orchestrate across a whole client fleet from a single dashboard.

| Stage | Skill | Role |
| --- | --- | --- |
| 🎨 Build | [siteagent-elementor-studio](https://github.com/Digitizers/siteagent-elementor-studio) · [elementor-mcp](https://github.com/Digitizers/elementor-mcp) | Design & build sites inside Elementor — the recipes, and the MCP engine under them |
| 🔎 Audit + Content | [**wordpress-api-pro** ← you are here](https://github.com/Digitizers/wordpress-api-pro) | REST content ops, SEO & site audits |
| 🖥 Host | [cloudways-mcp](https://github.com/Digitizers/cloudways-mcp) · [hostinger-mcp](https://github.com/Digitizers/hostinger-mcp) | Provision & operate the infrastructure |
| 🚀 Deliver | [bunny-mcp](https://github.com/Digitizers/bunny-mcp) | CDN, storage & edge delivery |
| 🛡 Govern | [aura-mcp](https://github.com/Digitizers/aura-mcp) | Drive the control plane — approvals, snapshots, rollbacks — over MCP |

**→ Orchestrate all of it across your client fleet with [Aura](https://my-aura.app)** — governed agent ops with approvals and a full audit trail on top of these skills.

## Seeding, or Aura content ops

This skill can **seed** content over the WordPress REST API — bulk-create posts, pages, and custom-post-type entries from a JSON dataset. It's the operator-side twin of Aura's content tools; which one to use comes down to who owns the site:

- **This skill (seeding)** — for sites you own or throwaway/staging sites: bulk scaffolding, demos, one-shot imports. Note: seeding is **not idempotent** — there's no upsert, so re-running the same seed duplicates content. Track what you've created.
- **Aura content ops** — for **managed client sites**, drive content through [Aura](https://my-aura.app) instead. Aura is the system-of-record: drafts-first and explicit-approval guardrails, a full audit trail, and content state it can reconcile. Seeding a managed site directly forks its content state out from under Aura.

Rule of thumb: seed sites you own; let Aura own content on sites you manage for others.

## Features

- ✅ **Elementor Content** — read and update Elementor page content via `_elementor_data`.
- ✅ **Media Upload** — upload images/files to the WordPress media library.
- ✅ **WooCommerce Products** — list, create, read, and update WooCommerce products.
- ✅ **Full CRUD** — create, read, update, and delete posts/pages.
- ✅ **Gutenberg Support** — native block format and content workflows.
- ✅ **Secure Auth** — WordPress Application Passwords recommended.
- ✅ **Media Management** — local media upload plus explicit opt-in remote HTTPS media.
- ✅ **Batch Operations** — list, filter, dry-run, and bulk update content.
- ✅ **Multi-Site Workflows** — manage named sites and site groups with `wp.sh`.
- ✅ **Plugin Support** — ACF, JetEngine, Rank Math, and Yoast SEO helpers.
- ✅ **Safety Gates** — dry-run defaults, explicit live-write flags, protected local file reads, and private-network URL blocking.
- ✅ **CI Verified** — tested on Python 3.11, 3.12, and 3.13.

## Package Layout

The actual skill payload lives in:

```text
wordpress-api-pro/
```

Repository-only files such as this README, changelog, license, CI, and package metadata intentionally stay outside the skill directory.

ClawHub package directory: `wordpress-api-pro/`.

## Version

Current version: **3.9.5**

## Installation

### Via OpenClaw / ClawHub

```bash
openclaw skills install wordpress-api-pro
```

### Manual Installation

```bash
cp -R wordpress-api-pro ~/.openclaw/workspace/skills/wordpress-api-pro
```

### Via Claude Code

The skill also runs in [Claude Code](https://claude.ai/download). The installer copies the payload into `~/.claude/skills/` so Claude Code discovers it automatically:

```bash
git clone https://github.com/Digitizers/wordpress-api-pro.git
cd wordpress-api-pro
bash INSTALL.sh
```

### Windows note

The plugin ships its skill through a git **symlink** (`skills/` → the in-repo
source). On Windows, enable Developer Mode and set
`git config --global core.symlinks true` **before** cloning or installing —
the plugin cache clone inherits it. Changing the config does not repair an
existing checkout (the repo may have recorded `core.symlinks=false` locally).
To repair one, run these two commands inside it (the second re-materializes
only the plugin's symlink entries, so nothing else in your working tree is
touched):

    git config core.symlinks true
    git checkout -- skills/ .claude/skills/

Or simply re-clone. WSL also works. macOS/Linux need nothing.

Then restart Claude Code, export `WP_URL` / `WP_USERNAME` / `WP_APP_PASSWORD` (or set up `config/sites.json`), and ask Claude to use it. The ACF / SEO / JetEngine / plugin-detection scripts need `requests` (`pip install -r wordpress-api-pro/requirements.txt`, which pins `requests>=2.32.3`); the core post/page/media/WooCommerce/batch scripts use the Python stdlib only.

> Pairs well with the [Elementor MCP kit](https://github.com/Digitizers/siteagent-elementor-studio): build pages with the MCP, then handle media uploads, SEO meta, custom fields, and WooCommerce with these scripts.

## Quick Start

### Option A: Multi-Site Setup — recommended for 2+ sites ⭐

**1. Copy config template:**

```bash
cd ~/.openclaw/workspace/skills/wordpress-api-pro
cp config/sites.example.json config/sites.json
chmod 600 config/sites.json
```

**2. Edit `config/sites.json`:**

```json
{
  "sites": {
    "client-main": {
      "url": "https://example.com",
      "username": "wp-api-user",
      "app_password": "",
      "description": "Primary client site"
    },
    "client-shop": {
      "url": "https://shop.example.com",
      "username": "wp-api-user",
      "app_password": "",
      "description": "WooCommerce shop"
    }
  },
  "groups": {
    "client": ["client-main", "client-shop"]
  }
}
```

Keep real credentials local only. Do not commit `config/sites.json`.

**3. Use the CLI wrapper:**

```bash
# List configured sites
./wp.sh --list-sites

# Read a post on a specific site
./wp.sh client-main get-post --id 123

# Update a post after approval
./wp.sh client-main update-post --id 123 --status draft

# Group operation requires explicit group execution flag
./wp.sh client --execute-group update-post --id 456 --status draft
```

### Option B: Single Site Setup

**1. Create an Application Password**

1. Open `https://your-site.example/wp-admin/profile.php`.
2. Scroll to **Application Passwords**.
3. Create a password for a dedicated API user.
4. Copy it once and store it in a secret manager or environment variable.

**2. Set environment variables**

```bash
export WP_URL="https://your-site.example"
export WP_USERNAME="wp-api-user"
read -rs WP_APP_PASSWORD
export WP_APP_PASSWORD
```

**3. Use the scripts**

```bash
cd wordpress-api-pro
```
````
