/install wp-publisher
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
- WordPress site with REST API enabled (native since WP 4.7)
- Create an Application Password: WP Admin → Users → Profile → Application Passwords
- Configure these env vars or replace in commands:
WP_API_BASE:https://your-blog.com/wp-json/wp/v2WP_USER: Your WordPress usernameWP_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(withdatefield)categories: array of category IDsslug: 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:
- Confirm topic + category — Ask if not specified
- Generate content — Write article in Markdown, then convert to HTML
- Call API — POST to WordPress REST API with Basic Auth
- 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"
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install wp-publisher - After installation, invoke the skill by name or use
/wp-publisher - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 37 downloads so far.
How do I install WP Publisher?
Run "/install wp-publisher" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is WP Publisher free?
Yes, WP Publisher is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does WP Publisher support?
WP Publisher is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created WP Publisher?
It is built and maintained by 佛系豪豪吖 (@foxihaohao); the current version is v1.0.0.