Asif

WordPress Publisher Skill

內容創作v0.1.0
作者:Asif更新於 2026-05-11wordpress-publishing-skill-for-claude@clawhub_asif2bd/wordpress-publishing-skill-for-claude
文章寫作行銷文案#Rest Api

據 AlphaMoat 統計,截至 2026-10,WordPress Publisher Skill 累計下載 10,370 次、獲 12 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 2,639 位,在「內容創作」分類(927 個)中排名第 268 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
1萬
星標
12
全站下載量排名
#2,639
全站前 25% · 「內容創作」前 29%
平台累計下載星標評論
ClawHub ↗562910-
SkillHub ↗1萬12—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

連線站點後讀取分類並自動匹配,按內容生成 SEO 標籤,再建立或釋出文章與頁面,釋出前可預覽 Gutenberg 區塊效果。認證必須使用應用密碼,不能用 WordPress 常規登入密碼。 發布會公開內容;預覽後須取得使用者核准再發布,並妥善保護 WordPress 應用密碼。

資料釋出於 2026-10-27

可以用來做什麼

  • 把一篇草稿按 Gutenberg 區塊格式釋出到站點。
  • 為文章自動挑選分類並生成 SEO 標籤。

什麼時候用

  • 需要從對話裡直接把內容推到 WordPress 時。
  • 站點分類多、手動挑選容易出錯時。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

把這篇稿子釋出到我的 WordPress 站點,自動選分類和標籤。
先按 Gutenberg 格式生成預覽,我確認後再發布。

月度資料趨勢

累計下載1萬
341871521.1萬2026-03 · 累計下載 39332026-05 · 累計下載 48242026-07 · 累計下載 53222026-08 · 累計下載 54622026-09 · 累計下載 62572026-10 · 累計下載 1萬26-0326-0926-10
星標12
1011122026-03 · 星標 102026-05 · 星標 122026-07 · 星標 122026-08 · 星標 122026-09 · 星標 122026-10 · 星標 1226-0326-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-101萬—12
2026-096257—12
2026-085462+2.6%12
2026-075322—12
2026-054824—12
2026-033933—10

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

10 KB · ClawHub v0.1.0
---
name: wordpress-publisher
description: Publish content directly to WordPress sites via REST API with full Gutenberg block support. Create and publish posts/pages, auto-load and select categories from website, generate SEO-optimized tags, preview articles before publishing, and generate Gutenberg blocks for tables, images, lists, and rich formatting. Use when user wants to publish to WordPress, post to blog, create WordPress article, update WordPress post, or convert markdown to Gutenberg blocks.
author: xCloud
version: 1.0.0
---

# WordPress Publisher

Publish content directly to WordPress sites using the REST API with full Gutenberg block formatting, automatic category selection, SEO tag generation, and preview capabilities.
展開全部(共 369 行)

## Complete Workflow Overview

```
1. CONNECT    → Authenticate with WordPress site
2. ANALYZE    → Load categories from site, analyze content for best match
3. GENERATE   → Create SEO-optimized tags based on content
4. CONVERT    → Transform markdown/HTML to Gutenberg blocks
5. PREVIEW    → Create draft and verify rendering
6. PUBLISH    → Publish or schedule the post
7. VERIFY     → Confirm live post renders correctly
```

---

## Step 1: Connection Setup

### Get Credentials
Ask user for:
- WordPress site URL (e.g., `https://example.com`)
- WordPress username
- Application password (NOT regular password)

### How to Create Application Password
Guide user:
1. Go to **Users → Profile** in WordPress admin
2. Scroll to **Application Passwords** section
3. Enter name: `Claude Publisher`
4. Click **Add New Application Password**
5. Copy the generated password (shown only once, with spaces)

### Test Connection
```python
from scripts.wp_publisher import WordPressPublisher

wp = WordPressPublisher(
    site_url="https://example.com",
    username="admin",
    password="xxxx xxxx xxxx xxxx xxxx xxxx"  # Application password
)

# Test connection
user_info = wp.test_connection()
print(f"Connected as: {user_info['name']}")
```

---

## Step 2: Load and Select Categories

### Auto-Load Categories from Site
```python
# Get all categories from the WordPress site
categories = wp.get_categories_with_details()

# Returns list like:
# [
#   {'id': 1, 'name': 'Uncategorized', 'slug': 'uncategorized', 'count': 5},
#   {'id': 2, 'name': 'Tutorials', 'slug': 'tutorials', 'count': 12},
#   {'id': 3, 'name': 'Cloud Hosting', 'slug': 'cloud-hosting', 'count': 8},
# ]
```

### Smart Category Selection
The system analyzes content and selects the most appropriate category:

```python
# Analyze content and suggest best category
suggested_category = wp.suggest_category(
    content=article_content,
    title=article_title,
    available_categories=categories
)

# Or let user choose from available options
print("Available categories:")
for cat in categories:
    print(f"  [{cat['id']}] {cat['name']} ({cat['count']} posts)")
```

### Category Selection Logic
1. **Exact match** - Title/content contains category name
2. **Keyword match** - Category slug matches topic keywords
3. **Parent category** - Fall back to broader parent if no match
4. **Create new** - Create category if none fit (with user approval)

---

## Step 3: Generate SEO-Optimized Tags

### Automatic Tag Generation
Generate tags that improve Google search visibility:

```python
# Generate tags based on content analysis
tags = wp.generate_seo_tags(
    content=article_content,
    title=article_title,
    max_tags=10
)

# Returns list like:
# ['n8n hosting', 'workflow automation', 'self-hosted n8n', 
#  'affordable hosting', 'docker deployment', 'node.js hosting']
```

### Tag Generation Rules
1. **Primary keyword** - Always include as first tag
2. **Secondary keywords** - Include 2-3 related terms
3. **Long-tail keywords** - Include 3-4 specific phrases
4. **Entity tags** - Include product/brand names mentioned
5. **Topic tags** - Include broader category terms

### Create/Get Tags in WordPress
```python
# Get or create all tags, returns list of tag IDs
tag_ids = wp.get_or_create_tags(tags)
```

---

## Step 4: Convert Content to Gutenberg Blocks

### Markdown to Gutenberg
```python
from scripts.content_to_gutenberg import convert_to_gutenberg

# Convert markdown content
gutenberg_content = convert_to_gutenberg(markdown_content)
```

### Supported Conversions

| Markdown | Gutenberg Block |
|----------|-----------------|
| `# Heading` | `wp:heading` |
| `**bold**` | `<strong>` in paragraph |
| `- list item` | `wp:list` |
| `1. ordered` | `wp:list {"ordered":true}` |
| `\`\`\`code\`\`\`` | `wp:code` |
| `> quote` | `wp:quote` |
| `![alt](url)` | `wp:image` |
| `\| table \|` | `wp:table` |

### Table Conversion (Critical for AI Content)
Tables are converted with proper Gutenberg structure:

```python
# Input markdown:
| Feature | Plan A | Plan B |
|---------|--------|--------|
| Price   | $10    | $20    |

# Output Gutenberg:
<!-- wp:table -->
<figure class="wp-block-table"><table>
  <thead><tr><th>Feature</th><th>Plan A</th><th>Plan B</th></tr></thead>
  <tbody><tr><td>Price</td><td>$10</td><td>$20</td></tr></tbody>
</table></figure>
<!-- /wp:table -->
```

---

## Step 5: Preview Before Publishing

### Create Draft for Preview
```python
# Create as draft first
result = wp.create_draft(
    title="Article Title",
    content=gutenberg_content,
    categories=[category_id],
    tags=tag_ids,
    excerpt="Auto-generated or custom excerpt"
)

post_id = result['post_id']
preview_url = result['preview_url']
edit_url = result['edit_url']
```

### Verify Preview
```python
# Fetch preview page to verify rendering
preview_content = wp.fetch_preview(post_id)

# Check for issues
issues = wp.validate_rendered_content(preview_content)
if issues:
    print("Issues found:")
    for issue in issues:
        print(f"  - {issue}")
```

### Preview Checklist
- [ ] Title displays correctly
- [ ] All headings render (H2, H3, H4)
- [ ] Tables render with proper formatting
- [ ] Lists display correctly (bullet and numbered)
- [ ] Code blocks have syntax highlighting
- [ ] Images load (if any)
- [ ] Links are clickable
- [ ] Category shows correctly
- [ ] Tags display in post

---

## Step 6: Publish the Post

### Publish Draft
```python
# After preview approval, publish
result = wp.publish_post(post_id)
live_url = result['live_url']
```

### Or Create and Publish Directly
```python
# Full publish workflow in one call
result = wp.publish_content(
    title="Article Title",
    content=gutenberg_content,
    category_names=["Cloud Hosting"],  # By name, auto-resolves to ID
    tag_names=["n8n", "hosting", "automation"],
    status="publish",  # or "draft", "pending", "private", "future"
    excerpt="Custom excerpt for SEO",
    slug="custom-url-slug"
)
```

### Scheduling Posts
```python
# Schedule for future publication
from datetime import datetime, timedelta

publish_date = datetime.now() + timedelta(days=1)
result = wp.publish_content(
    title="Scheduled Post",
    content=content,
    status="future",
    date=publish_date.isoformat()
)
```

---

## Step 7: Verify Published Post

### Check Live Post
```python
# Verify the published post
verification = wp.verify_published_post(post_id)

print(f"Live URL: {verification['url']}")
print(f"Status: {verification['status']}")
print(f"Categories: {verification['categories']}")
print(f"Tags: {verification['tags']}")
```

### Common Issues and Fixes

| Issue | Cause | Solution |
|-------|-------|----------|
| Tables not rendering | Missing figure wrapper | Use proper `wp:table` block structure |
| Code not highlighted | Missing language attribute | Add `{"language":"python"}` to code block |
| Images broken | Wrong URL or missing media | Upload to WordPress first, use media ID |
| Tags not showing | Theme doesn't display tags | Check theme settings or use different theme |

---

## Complete Example Workflow

```python
from scripts.wp_publisher import WordPressPublisher
from scripts.content_to_gutenberg import convert_to_gutenberg

# 1. Connect
wp = WordPressPublisher(
    site_url="https://xcloud.host",
    username="admin",
    password="xxxx xxxx xxxx xxxx"
)

# 2. Load categories and select best match
categories = wp.get_categories_with_details()
best_category = wp.suggest_category(content, title, categories)

# 3. Generate SEO tags
tags = wp.generate_seo_tags(content, title, max_tags=10)

# 4. Convert to Gutenberg
gutenberg_content = convert_to_gutenberg(markdown_content)

# 5. Create draft and preview
draft = wp.create_draft(
    title="7 Best n8n Hosting Providers in 2026",
    content=gutenberg_content,
    categories=[best_category['id']],
    tags=wp.get_or_create_tags(tags)
)
print(f"Preview: {draft['preview_url']}")

# 6. After verification, publish
result = wp.publish_post(draft['post_id'])
print(f"Published: {result['live_url']}")
```

---

## Quick Reference

### API Endpoints
| Resource | Endpoint |
|----------|----------|
| Posts | `/wp-json/wp/v2/posts` |
| Pages | `/wp-json/wp/v2/pages` |
| Categories | `/wp-json/wp/v2/categories` |
| Tags | `/wp-json/wp/v2/tags` |
| Media | `/wp-json/wp/v2/media` |

### Post Statuses
| Status | Description |
|--------|-------------|
| `publish` | Live and visible |
| `draft` | Saved but not visible |
| `pending` | Awaiting review |
| `private` | Only visible to admins |
| `future` | Scheduled for later |

### Required Files
- `scripts/wp_publisher.py` - Main publisher class
- `scripts/content_to_gutenberg.py` - Markdown/HTML converter
- `references/gutenberg-blocks.md` - Block format reference

---

## Error Handling

| Error Code | Meaning | Solution |
|------------|---------|----------|
| 401 | Invalid credentials | Check username and application password |
| 403 | Insufficient permissions | User needs Editor or Admin role |
| 404 | Endpoint not found | Verify REST API is enabled |
| 400 | Invalid data | Check category/tag IDs exist |
| 500 | Server error | Retry or check WordPress error logs |

---

## Best Practices

1. **Always preview first** - Create as draft, verify, then publish
2. **Use application passwords** - Never use regular WordPress password
3. **Select appropriate category** - Helps with site organization and SEO
4. **Generate relevant tags** - Improves Google discoverability
5. **Validate Gutenberg blocks** - Ensure proper block structure
6. **Keep excerpts under 160 chars** - Optimal for search snippets
7. **Use descriptive slugs** - Include primary keyword in URL

「內容創作」分類下的熱門技能

李白.Skill內容創作

李白.Skill:潤色專家 檢測並消除中文文字中的AI生成痕跡,將生硬的機器輸出轉化為自然流暢的人類文筆。融合規則檢測、分層改寫(詞彙→句式→內容→邏輯→語氣)和六步質控流水線,確保最終文字透過人工審查。

↓ 125萬★ 121user_741dc82b
libai-skill內容創作

李白.Skill:潤色專家 檢測並消除中文文字中的AI生成痕跡,將生硬的機器輸出轉化為自然流暢的人類文筆。融合規則檢測、分層改寫和質控流水線,確保最終文字透過人工審查。

↓ 101.8萬★ 11user_814dbe54
文章去AI味工具內容創作

識別並去掉文字里的 AI 寫作痕跡,讓文字讀起來更像人寫。

↓ 95.1萬★ 767user_ab5ae6ee
影片號爆款短影片拆解(付費版:全能)【零一數科·出品】內容創作

【零一數科·出品】影片號爆款短影片拆解(全能版)(付費版)。影片號爆款短影片拆解(付費版:全能)。一鍵拆解爆款,把一條影片號影片拆成結構分段、爆款歸因、六維評分和可借鑑策略,照著學照著抄。支援影片號分享連結和本地影片,付費全能版遠端分析,1–5 分鐘出視覺化 HTML 報告。

↓ 91.9萬★ 116u_c19e970c
影片號掛車爆單短影片指令碼生成【零一數科·出品】內容創作

【零一數科·出品】影片號掛車爆單短影片指令碼生成(付費版)。一條連結二創指令碼,丟進爆款影片號連結即以此骨架改寫成你的掛車指令碼,或按方向/目的/商品原創多條口播指令碼(含分段表、口播全文、六維質檢評分)。

↓ 55.4萬★ 39u_c19e970c
Humanizer內容創作

把文字里 AI 寫作的典型痕跡挑出來並改寫得更自然,同時保留原意的寫作編輯技能。

↓ 50.9萬★ 1116B*T
中文公文寫作內容創作

用於中文公文、事務性材料和新聞稿件的起草、改寫、壓縮、潤色、審校、文種核對、去口語化、降 AI 味及 Word 格式處理,適用於機關、企事業單位、學校和新聞機構。涵蓋申請、請示、報告、通知、通告、意見、決定、決議、議案、公報、命令、函、覆函、批覆、說明、方案、紀要、公告、公示、通報、制度、規定、辦法、細則、操作規程、工作要點、總結、調研、講話、致辭、主持詞、述職、可研、審查材料、技術需求、新聞訊息、編者按、新聞評論,以及採購、整改、反饋和 AI 算力等場景。

↓ 41.3萬★ 84gongyu0918
影片號爆款文案生成(體驗版)【零一數科·出品】內容創作

【零一數科·出品】影片號爆款文案生成(體驗版)。免費免登入出指令碼,給創作目的、行業、受眾、選題就按爆款結構(Hook-中段-CTA、節奏標籤)產出口播指令碼,資訊不全也能按爆款潛質兜底。本地執行、無需 Key,零成本上手。

↓ 33.9萬★ 94u_c19e970c

Asif 的其他技能

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。