← Back to Skills Marketplace
foxihaohao

WP Publisher

by 佛系豪豪吖 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
37
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install wp-publisher
Description
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...
README (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"
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install wp-publisher
  3. After installation, invoke the skill by name or use /wp-publisher
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug wp-publisher
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

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.

💬 Comments