wordpress-publisher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WordPress Publisher

WordPress 发布器

First time? If
setup_complete: false
above, run
./SETUP.md
first, then set
setup_complete: true
.
Publish content to WordPress with a two-step flow: draft first, then publish after user confirmation.
首次使用? 如果上方的
setup_complete: false
,请先运行
./SETUP.md
,然后将
setup_complete
设置为
true
通过两步流程将内容发布到WordPress:先创建草稿,再经用户确认后发布。

Default Language: Hebrew

默认语言:希伯来语

IMPORTANT: Unless the user explicitly requests English or another language, create all blog posts in Hebrew with RTL formatting. Also generate images using the
image-generation
skill for:
  • Featured/hero image for the post
  • Internal images to illustrate concepts (instead of ASCII diagrams)
Always wrap Hebrew content in:
html
<article dir="rtl" lang="he">
  <!-- Hebrew content here -->
</article>
重要提示: 除非用户明确要求使用英语或其他语言,否则所有博客文章都需以希伯来语创建并采用RTL格式。同时使用
image-generation
技能生成图片,用于:
  • 文章的特色/首图
  • 用于阐释概念的内部图片(替代ASCII图表)
请始终将希伯来语内容包裹在以下代码块中:
html
<article dir="rtl" lang="he">
  <!-- Hebrew content here -->
</article>

Configuration

配置

Create
.env
file in the skill directory:
bash
undefined
在技能目录中创建
.env
文件:
bash
undefined

~/.claude/skills/wordpress-publisher/.env

~/.claude/skills/wordpress-publisher/.env

WP_URL=https://your-site.com WP_USERNAME=your_username WP_APP_PASSWORD=YourApplicationPasswordNoSpaces

**Creating Application Password:**
1. Go to WordPress Admin → Users → Profile
2. Scroll to "Application Passwords"
3. Enter a name (e.g., "Claude Code") and click "Add New"
4. Copy the password and **remove all spaces**
WP_URL=https://your-site.com WP_USERNAME=your_username WP_APP_PASSWORD=YourApplicationPasswordNoSpaces

**创建应用密码:**
1. 进入WordPress后台 → 用户 → 个人资料
2. 滚动至“应用密码”部分
3. 输入名称(例如:"Claude Code")并点击“添加新密码”
4. 复制密码并**移除所有空格**

Usage

使用方法

Create Draft

创建草稿

bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html
bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html

Create with Featured Image

创建带特色图片的草稿

bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html --image=cover.jpg
bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html --image=cover.jpg

Create and Publish Immediately

直接创建并发布

bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html --publish
bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Post Title" content.html --publish

Publish Existing Draft

发布现有草稿

bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js publish POST_ID
bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js publish POST_ID

Check Post Status

从标准输入读取内容

bash
node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js status POST_ID
bash
echo "<h1>Hello</h1>" | node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Hello" -

Read from stdin

选项

bash
echo "<h1>Hello</h1>" | node ~/.claude/skills/wordpress-publisher/scripts/wp-publish.js create "Hello" -
选项描述
--publish
立即发布(默认:草稿)
--image=<path>
特色图片(将上传至媒体库)
--excerpt=<text>
添加摘要
--categories=<ids>
分类ID(逗号分隔)
--tags=<ids>
标签ID(逗号分隔)

Options

响应格式

创建草稿后:

OptionDescription
--publish
Publish immediately (default: draft)
--image=<path>
Featured image (uploaded to media library)
--excerpt=<text>
Add excerpt
--categories=<ids>
Category IDs (comma-separated)
--tags=<ids>
Tag IDs (comma-separated)
Draft created!

**Post ID:** 123
**Edit in WordPress:** https://your-site.com/wp-admin/post.php?post=123&action=edit
**Preview:** https://your-site.com/?p=123

Publish now or review first?

Response Format

发布后:

After Creating Draft:

Draft created!

**Post ID:** 123
**Edit in WordPress:** https://your-site.com/wp-admin/post.php?post=123&action=edit
**Preview:** https://your-site.com/?p=123

Publish now or review first?
Post is live!

**URL:** https://your-site.com/your-post-slug/

After Publishing:

错误处理

Post is live!

**URL:** https://your-site.com/your-post-slug/
错误原因解决方案
401 Unauthorized凭据错误检查WP_USERNAME和WP_APP_PASSWORD
403 Forbidden无权限确保用户拥有编辑/管理员角色
404 Not FoundURL错误或API已禁用检查WP_URL,启用REST API

Error Handling

希伯来语/RTL 内容

ErrorCauseSolution
401 UnauthorizedWrong credentialsCheck WP_USERNAME and WP_APP_PASSWORD
403 ForbiddenNo permissionsEnsure user has Editor/Admin role
404 Not FoundWrong URL or API disabledCheck WP_URL, enable REST API
对于希伯来语内容,请包裹在RTL容器中:
html
<article dir="rtl" lang="he">
  <!-- Hebrew content here -->
</article>

Hebrew/RTL Content

For Hebrew content, wrap in RTL container:
html
<article dir="rtl" lang="he">
  <!-- Hebrew content here -->
</article>