home / skills / aviz85 / claude-skills-library / wordpress-publisher

This skill publishes WordPress posts by creating drafts or publishing after confirmation, integrating title, content, and optional media.

npx playbooks add skill aviz85/claude-skills-library --skill wordpress-publisher

Review the files below or copy the command above to add this skill to your agents.

Files (4)
skill.md
2.8 KB
No content available

Overview

This skill publishes posts to WordPress using a simple two-step flow: create a draft, then publish after confirmation. It supports featured images, excerpts, categories, tags, and immediate publish flags. Configuration uses environment variables for site URL and an application password for secure REST API access.

How this skill works

The skill calls the WordPress REST API to create or update posts and to upload media when a featured image is provided. By default it creates a draft and returns the post ID, edit link, and preview URL; you can then publish the draft or choose the --publish flag to publish immediately. It handles common API error codes and returns actionable messages for credential, permission, or URL problems.

When to use it

  • Publish a new blog post from HTML or stdin without logging into WordPress admin.
  • Upload a featured image and attach it to a post during creation.
  • Create drafts for review before making posts public.
  • Quickly publish an approved draft by post ID.
  • Check publish status or preview links for recent posts.

Best practices

  • Set WP_URL, WP_USERNAME and an application password in a local .env for secure API access.
  • Use the two-step flow (draft then publish) for editorial review and safe publishing.
  • Remove spaces from WordPress application passwords when copying them into the env file.
  • Provide HTML content or use stdin for automated pipelines and CI integration.
  • Wrap RTL/Hebrew content in an <article dir="rtl" lang="he"> container to preserve directionality.

Example use cases

  • Create a draft from a prepared HTML file: create "Post Title" content.html
  • Create a post with a featured image: create "Post Title" content.html --image=cover.jpg
  • Publish an existing draft by ID: publish 123
  • Publish immediately from a script using the --publish flag for automated workflows
  • Stream content into the tool via stdin for dynamic content generation and posting

FAQ

What credentials are required?

You need WP_USERNAME and a WordPress application password (no spaces) set alongside WP_URL in the environment file.

Why do I get 401 or 403 errors?

401 means incorrect credentials; double-check username and app password. 403 means the user lacks Editor/Admin permissions—grant appropriate role.