← 返回 Skills 市场
foxihaohao

WP Publisher

作者 佛系豪豪吖 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
37
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install wp-publisher
功能描述
Publish WordPress posts via REST API from any OpenClaw channel (WeChat/QQ/DingTalk/etc). AI writes in Markdown, auto-converts to HTML, posts to your blog, an...
使用说明 (SKILL.md)

WP Publisher — Remote WordPress Blog Publishing

Publish posts to your WordPress blog from any OpenClaw channel. Send "发布博客" in WeChat and AI handles the rest.

Prerequisites

  1. WordPress site with REST API enabled (native since WP 4.7)
  2. Create an Application Password: WP Admin → Users → Profile → Application Passwords
  3. Configure these env vars or replace in commands:
    • WP_API_BASE: https://your-blog.com/wp-json/wp/v2
    • WP_USER: Your WordPress username
    • WP_APP_PASSWORD: Generated application password

Available Categories (customize per site)

Get your own categories:

curl -sk -u "USER:PASS" "$WP_API_BASE/categories?per_page=50" | python3 -c "
import sys,json
for c in json.load(sys.stdin):
    print(f'{c[\"id\"]}: {c[\"name\"]}')
"

API Operations

Create Post (Publish)

curl -sk -u "USER:PASS" \
  -X POST "$WP_API_BASE/posts" \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Post Title",
    "content": "\x3Cp>HTML content here\x3C/p>",
    "status": "publish",
    "categories": [CAT_ID],
    "slug": "post-slug"
  }' | python3 -c "import sys,json;d=json.load(sys.stdin);print(f'Published: {d[\"link\"]}')"

Params:

  • status: publish | draft | future (with date field)
  • categories: array of category IDs
  • slug: URL slug (optional, auto-generated from title)
  • tags: array of tag IDs (optional)

List Posts

curl -sk -u "USER:PASS" "$WP_API_BASE/posts?per_page=5&search=keyword"

Update Post

curl -sk -u "USER:PASS" \
  -X PUT "$WP_API_BASE/posts/POST_ID" \
  -H 'Content-Type: application/json' \
  -d '{"title":"New Title","content":"\x3Cp>Updated\x3C/p>"}'

Delete Post

curl -sk -u "USER:PASS" -X DELETE "$WP_API_BASE/posts/POST_ID?force=true"

Workflow

When user asks to publish a blog post:

  1. Confirm topic + category — Ask if not specified
  2. Generate content — Write article in Markdown, then convert to HTML
  3. Call API — POST to WordPress REST API with Basic Auth
  4. Reply with link — Give user the published article URL

Markdown → HTML Conversion

Run this Python snippet before posting:

import re

def md2html(md):
    md = re.sub(r'```([\s\S]*?)```', r'\x3Cpre>\x3Ccode>\1\x3C/code>\x3C/pre>', md)
    md = re.sub(r'`([^`]+)`', r'\x3Ccode>\1\x3C/code>', md)
    md = re.sub(r'^### (.+)$', r'\x3Ch4>\1\x3C/h4>', md, flags=re.M)
    md = re.sub(r'^## (.+)$', r'\x3Ch3>\1\x3C/h3>', md, flags=re.M)
    md = re.sub(r'^# (.+)$', r'\x3Ch2>\1\x3C/h2>', md, flags=re.M)
    md = re.sub(r'\*\*\*(.+?)\*\*\*', r'\x3Cstrong>\x3Cem>\1\x3C/em>\x3C/strong>', md)
    md = re.sub(r'\*\*(.+?)\*\*', r'\x3Cstrong>\1\x3C/strong>', md)
    md = re.sub(r'\*(.+?)\*', r'\x3Cem>\1\x3C/em>', md)
    md = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'\x3Ca href="\2">\1\x3C/a>', md)
    md = re.sub(r'^- (.+)$', r'\x3Cli>\1\x3C/li>', md, flags=re.M)
    md = re.sub(r'(\x3Cli>.*\x3C/li>\
?)+', r'\x3Cul>\g\x3C0>\x3C/ul>', md)
    md = re.sub(r'^(?!\x3C[a-z/]|$)(.+)$', r'\x3Cp>\1\x3C/p>', md, flags=re.M)
    return md.strip()

Notes

  • Content must be HTML, not raw Markdown
  • Special chars in title auto-handled by WordPress
  • Article link format: https://your-blog.com/archives/{ID} (varies by permalink setting)
  • For scheduled posts: "status":"future","date":"2026-06-10T09:00:00"
安全使用建议
Install only if you are comfortable giving the agent WordPress content-management access. Use a dedicated low-privilege WordPress application password, require HTTPS without disabling certificate checks, avoid putting secrets directly in commands, and treat update/delete actions as requiring explicit human confirmation.
能力评估
Purpose & Capability
The stated purpose is publishing WordPress posts, but the documented API operations also include updating posts and force-deleting posts; those are high-impact content management actions beyond a simple publish workflow.
Instruction Scope
The workflow asks the agent to confirm topic and category before publishing, but the update and delete operations do not require explicit confirmation, post ID echoing, draft-first behavior, or other guardrails.
Install Mechanism
The package contains only a SKILL.md file with no executable scripts, dependency installs, background workers, or hidden install behavior.
Credentials
WordPress API credentials are expected for this purpose, but the examples use inline Basic Auth and curl -k, which can weaken transport safety and increase accidental credential exposure.
Persistence & Privilege
No local persistence or privilege escalation is present, but the WordPress application password could grant ongoing remote publishing, editing, and deletion authority depending on the configured account.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install wp-publisher
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /wp-publisher 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Publish WordPress posts via REST API from any OpenClaw channel (WeChat/QQ/DingTalk). AI writes Markdown, auto-converts to HTML, posts and returns the link.
元数据
Slug wp-publisher
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

WP Publisher 是什么?

Publish WordPress posts via REST API from any OpenClaw channel (WeChat/QQ/DingTalk/etc). AI writes in Markdown, auto-converts to HTML, posts to your blog, an... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 37 次。

如何安装 WP Publisher?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install wp-publisher」即可一键安装,无需额外配置。

WP Publisher 是免费的吗?

是的,WP Publisher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

WP Publisher 支持哪些平台?

WP Publisher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 WP Publisher?

由 佛系豪豪吖(@foxihaohao)开发并维护,当前版本 v1.0.0。

💬 留言讨论