Publishing (Phase 4)
Goal: Push AI-generated content to WordPress automatically via wp-cli, then finalize in the WordPress editor.
How It Works
Content generation produces markdown files locally. A wp-cli script reads the markdown, converts it to HTML, and creates WordPress posts automatically — including categories, tags, and status. No manual copy-paste needed.
Data Flow
Markdown file (local) → wp-cli script → WordPress post (draft)
↓
Final editing in WordPress:
- Add images
- Add admonitions
- Add internal links
- Add featured image
- Publish live
wp-cli Post Creation
# Create a post from markdown content
wp post create \
--post_title="How to Read a Balance Sheet" \
--post_content="$(cat FS-0001.md | markdown-to-html)" \
--post_status=draft \
--post_category="Financial Statements" \
--tags_input="balance sheet, financial statements"
Key wp-cli parameters:
| Parameter | Source |
|---|---|
--post_title | From generated markdown frontmatter or first H1 |
--post_content | Markdown converted to HTML |
--post_status | draft (default) — you publish after final edits |
--post_category | Maps from Topic column in pipeline CSV |
--tags_input | From WP Tag column |
--porcelain | Returns new post ID for tracking |
Publishing Status Flow
Pipeline Status: Writing → Editing → Scheduled → Published
WP Status: Draft → Scheduled → Published
- Script runs — reads pipeline CSV for rows in
Writingstatus - Post created — wp-cli creates the post as
draftin WordPress - You edit — log into WordPress, add images, admonitions, internal links, featured image
- You publish — set status to
Publishedin WordPress - Link tracked — paste the WordPress permalink back into the pipeline CSV
What You Do in WordPress
The automated publish creates a clean draft. You handle the visual polish:
- Images — add featured image and inline media
- Admonitions — use
generateblocksorgreenshift-animation-and-page-builder-blocksfor styled callouts - Internal links — link to other relevant posts
- Table of Contents — auto-generated by
wpstrategist-greenshift-toc-automation - Mermaid diagrams — rendered by
wpstrategist-mermaid-js - Code blocks — styled by
code-block-pro - Final review — check formatting, fix any HTML artifacts
Available Plugins (opshell.dev)
| Plugin | Purpose |
|---|---|
generateblocks + generateblocks-pro | Block-based page builder |
gp-premium | GeneratePress theme premium features |
greenshift-animation-and-page-builder-blocks | Animation and layout blocks |
greenshiftseo | On-page SEO meta |
greenshiftquery | Dynamic content queries |
wp-seopress + wp-seopress-pro | SEO metadata, XML sitemaps |
code-block-pro | Syntax-highlighted code blocks |
opshell-docusaurus-admonitions | Docusaurus-style admonition blocks |
opshell-gp-elements-organizer | GP elements management |
wpstrategist-mermaid-js | Mermaid diagram rendering |
wpstrategist-greenshift-toc-automation | Auto table of contents |
wpstrategist-authority-contents-sidebars | Authority content sidebars |
wpstrategist-seo-architecture | SEO architecture management |
advanced-custom-fields-pro | Custom fields and meta boxes |
admin-columns-pro | Admin column management |
perfmatters | Performance optimization |
litespeed-cache | Caching and optimization |
suremembers + suremembers-core | Membership and access control |
fluent-cart + fluent-cart-pro | E-commerce cart |
fluent-affiliate + fluent-affiliate-pro | Affiliate management |
Taxonomy Management
- Categories map to the
Topiccolumn and must be pre-created in WordPress - Tags are defined in the
WP Tagcolumn as comma-separated values - Pillar Pages are WordPress Pages, regular content is Posts
tip
Always publish as Draft first, then do your visual editing in WordPress before publishing live. Use the --porcelain flag with wp-cli to get the post ID for CSV tracking.