TopRank Skills

Home / Claw Skills / API Integration / wordpress-api-gutenberg
Official OpenClaw rules 36%

wordpress-api-gutenberg

Create, edit, and publish WordPress posts via REST API with full Gutenberg block support. Use when Codex needs to automate WordPress content publishing, generate articles programmatically, or manage posts through API calls. Includes authentication methods (JWT, Application Passwords), Gutenberg block serialization, featured images, categories, tags, and draft/publish workflows.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 wordpress-api-gutenberg 技能。 若已安装,则直接安装 wordpress-api-gutenberg 技能。

Overview

Skill Key
chirukinbb/wordpress-api-gutenberg
Author
chirukinbb
Source Repo
openclaw/skills
Version
-
Source Path
skills/chirukinbb/wordpress-api-gutenberg
Latest Commit SHA
d6ec91fe5966a69940bb7f1ec49277c01ef393b5

Extracted Content

SKILL.md excerpt

# WordPress API with Gutenberg

## Overview

This skill provides comprehensive guidance for interacting with WordPress REST API to create and manage posts using Gutenberg block editor format. It covers authentication, block serialization, media upload, and publishing workflows.

## Quick Start

Before using the API, ensure you have:

1. **WordPress site** with REST API enabled (default)
2. **Authentication credentials**:
   - Application Password (WordPress 5.6+): Generate at `/wp-admin/admin.php?page=application-passwords`
   - JWT Authentication plugin installed (alternative)
   - Username/password for Basic Auth (not recommended for production)

3. **Base URL**: `https://your-site.com/wp-json/wp/v2`

## Authentication

### Application Password (Recommended)

```bash
# Set environment variables
export WP_URL="https://your-site.com"
export WP_USERNAME="admin"
export WP_APPLICATION_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx"
```

```python
import requests
import os

wp_url = os.environ.get('WP_URL')
username = os.environ.get('WP_USERNAME')
password = os.environ.get('WP_APPLICATION_PASSWORD')

auth = (username, password)
```

### JWT Authentication

If using JWT plugin, obtain token first:

```python
import requests

wp_url = "https://your-site.com"
username = "admin"
password = "password"

# Get token
resp = requests.post(f"{wp_url}/wp-json/jwt-auth/v1/token", 
                     json={"username": username, "password": password})
token = resp.json()['token']

headers = {"Authorization": f"Bearer {token}"}
```

## Creating Posts with Gutenberg Blocks

WordPress REST API expects posts in Gutenberg's serialized block format. The content field should contain block comments and HTML.

### Basic Block Structure

```python
def create_gutenberg_post(title, content_blocks):
    """
    Create a post with Gutenberg blocks.
    
    Args:
        title: Post title
        content_blocks: List of block dictionaries with 'blockName' and 'attrs'
    
    Returns:
        JSON data...

Related Claw Skills