wordpress-content-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWordPress Content Manager
WordPress 内容管理器
Manage WordPress posts via the REST API. Fully configurable via environment variables - no manual file editing required.
通过REST API管理WordPress文章。可通过环境变量完全配置——无需手动编辑文件。
Required Environment Variables
必需的环境变量
Before using this skill, the agent must ensure these environment variables are set. If any are missing, ask the user for the values and set them before proceeding.
| Variable | Description | Example |
|---|---|---|
| WordPress site base URL | |
| WordPress username | |
| WordPress Application Password | |
How to get an Application Password:
- Log in to WordPress admin
- Go to Users → Profile
- Scroll to "Application Passwords"
- Enter a name and click "Add New Application Password"
- Copy the generated password (spaces are optional)
使用此工具前,需确保已设置以下环境变量。若有缺失,请向用户询问对应值并设置后再继续。
| 变量名 | 描述 | 示例 |
|---|---|---|
| WordPress站点基础URL | |
| WordPress用户名 | |
| WordPress应用密码 | |
如何获取应用密码:
- 登录WordPress后台
- 进入 用户 → 个人资料
- 滚动到“应用密码”区域
- 输入名称并点击“添加新应用密码”
- 复制生成的密码(空格可选)
Optional Environment Variables
可选环境变量
| Variable | Description | Default |
|---|---|---|
| REST API base URL | |
| 变量名 | 描述 | 默认值 |
|---|---|---|
| REST API基础URL | |
First-Time Setup
首次设置
Run the setup script after setting the required environment variables. It installs Node.js dependencies and validates the connection.
设置好必需的环境变量后,运行设置脚本。它会安装Node.js依赖并验证连接。
Linux/macOS
Linux/macOS
bash
export WP_SITE_URL="https://your-site.com"
export WP_USERNAME="your-username"
export WP_APP_PASSWORD="your-app-password"
bash ~/.claude/skills/wordpress-content-manager/scripts/setup.shbash
export WP_SITE_URL="https://your-site.com"
export WP_USERNAME="your-username"
export WP_APP_PASSWORD="your-app-password"
bash ~/.claude/skills/wordpress-content-manager/scripts/setup.shWindows (PowerShell)
Windows (PowerShell)
powershell
$env:WP_SITE_URL = "https://your-site.com"
$env:WP_USERNAME = "your-username"
$env:WP_APP_PASSWORD = "your-app-password"
pwsh ~/.claude/skills/wordpress-content-manager/scripts/setup.ps1If using Codex CLI, replace with .
~/.claude/skills~/.codex/skillsIf Node.js is missing, the setup script will attempt to install it using common package managers.
powershell
$env:WP_SITE_URL = "https://your-site.com"
$env:WP_USERNAME = "your-username"
$env:WP_APP_PASSWORD = "your-app-password"
pwsh ~/.claude/skills/wordpress-content-manager/scripts/setup.ps1如果使用Codex CLI,请将替换为。
~/.claude/skills~/.codex/skills若缺少Node.js,设置脚本会尝试通过常用包管理器进行安装。
Commands
命令
All commands are non-interactive and return JSON when is set.
--json所有命令均为非交互式,当添加参数时会返回JSON格式结果。
--jsonDescribe Connection
查看连接信息
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs site info --jsonbash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs site info --jsonList or Search Posts
列出或搜索文章
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts list --status publish --search "keyword" --per_page 20 --page 1bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts list --status publish --search "keyword" --per_page 20 --page 1View a Post
查看单篇文章
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts get 123 --jsonbash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts get 123 --jsonCreate a Post (HTML or Markdown)
创建文章(HTML或Markdown格式)
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts create \
--title "New Post" \
--content-file ./post.md \
--status draft \
--categories 1,2 \
--tags 5,7bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts create \
--title "New Post" \
--content-file ./post.md \
--status draft \
--categories 1,2 \
--tags 5,7Schedule a Post
定时发布文章
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts create \
--title "Scheduled Post" \
--content "<p>HTML body</p>" \
--status future \
--date "2025-01-15T15:30:00"bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts create \
--title "Scheduled Post" \
--content "<p>HTML body</p>" \
--status future \
--date "2025-01-15T15:30:00"Update a Post
更新文章
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts update 123 \
--title "Updated Title" \
--status publishbash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts update 123 \
--title "Updated Title" \
--status publishDelete a Post
删除文章
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete 123bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete 123Bulk Delete (Dry-Run First)
批量删除(先试运行)
bash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete-many \
--status draft \
--search "test" \
--dry-run
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete-many \
--status draft \
--search "test" \
--confirmbash
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete-many \
--status draft \
--search "test" \
--dry-run
node ~/.claude/skills/wordpress-content-manager/scripts/wp-content.mjs posts delete-many \
--status draft \
--search "test" \
--confirmAdvanced: Profile Files (Optional)
进阶:配置文件(可选)
For convenience, you can create profile files in to store site configurations. Environment variables always override profile values.
profiles/See for the profile format.
references/profiles.mdSelect a profile with or .
--profile <name>WP_PROFILE=<name>为方便使用,你可以在目录下创建配置文件来存储站点配置。环境变量始终会覆盖配置文件中的值。
profiles/配置文件格式请参考。
references/profiles.md可通过或选择配置文件。
--profile <name>WP_PROFILE=<name>