Skip to main content

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:

ParameterSource
--post_titleFrom generated markdown frontmatter or first H1
--post_contentMarkdown converted to HTML
--post_statusdraft (default) — you publish after final edits
--post_categoryMaps from Topic column in pipeline CSV
--tags_inputFrom WP Tag column
--porcelainReturns new post ID for tracking

Publishing Status Flow

Pipeline Status: Writing → Editing → Scheduled → Published
WP Status: Draft → Scheduled → Published
  1. Script runs — reads pipeline CSV for rows in Writing status
  2. Post created — wp-cli creates the post as draft in WordPress
  3. You edit — log into WordPress, add images, admonitions, internal links, featured image
  4. You publish — set status to Published in WordPress
  5. 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 generateblocks or greenshift-animation-and-page-builder-blocks for 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)

PluginPurpose
generateblocks + generateblocks-proBlock-based page builder
gp-premiumGeneratePress theme premium features
greenshift-animation-and-page-builder-blocksAnimation and layout blocks
greenshiftseoOn-page SEO meta
greenshiftqueryDynamic content queries
wp-seopress + wp-seopress-proSEO metadata, XML sitemaps
code-block-proSyntax-highlighted code blocks
opshell-docusaurus-admonitionsDocusaurus-style admonition blocks
opshell-gp-elements-organizerGP elements management
wpstrategist-mermaid-jsMermaid diagram rendering
wpstrategist-greenshift-toc-automationAuto table of contents
wpstrategist-authority-contents-sidebarsAuthority content sidebars
wpstrategist-seo-architectureSEO architecture management
advanced-custom-fields-proCustom fields and meta boxes
admin-columns-proAdmin column management
perfmattersPerformance optimization
litespeed-cacheCaching and optimization
suremembers + suremembers-coreMembership and access control
fluent-cart + fluent-cart-proE-commerce cart
fluent-affiliate + fluent-affiliate-proAffiliate management

Taxonomy Management

  • Categories map to the Topic column and must be pre-created in WordPress
  • Tags are defined in the WP Tag column 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.