AgentSkillsCN

Content Workflows

当用户询问“如何批量更新产品”、“管理 WordPress 文章的最佳方式”、“WooCommerce 工作流程”、“内容管理策略”、“整理 WordPress 内容”时,或当用户提及批量操作、内容迁移、分类管理、订单处理流程,又或是需要关于 WordPress/WooCommerce 内容管理模式与最佳实践的指导时,可调用此技能。

SKILL.md
--- frontmatter
description: This skill should be used when the user asks "how do I bulk update products", "best way to manage WordPress posts", "WooCommerce workflow", "content management strategies", "organize WordPress content", mentions bulk operations, content migrations, category management, order processing workflows, or needs guidance on WordPress/WooCommerce content management patterns and best practices.

WordPress & WooCommerce Content Management Workflows

Best practices, common patterns, and efficient workflows for managing WordPress and WooCommerce content through Claude Code.

When to Use This Skill

Activate this skill when user needs:

  • Bulk content operations (updating many items at once)
  • Content organization strategies (categories, tags, hierarchies)
  • Migration workflows (moving content between categories, states, etc.)
  • Order processing patterns
  • Media management approaches
  • SEO and content optimization workflows
  • Common WooCommerce/WordPress tasks and patterns

Core Principles

1. Backup Before Major Operations

Always create backups before:

  • Bulk deletions
  • Large-scale updates
  • Content migrations
  • Category reorganizations
  • Price changes across many products

How:

code
"Create a backup of all products before I update prices"
/wc-wp:backup --type products

Plugin automatically creates backups before deletions and bulk updates, but manual backups are recommended for safety.

2. Preview Before Committing

For bulk operations:

  • First, query to see what will be affected
  • Review the list
  • Then proceed with the operation

Example:

code
User: "Update all products in Clearance category to 50% off"
Claude: Shows list of affected products first
Claude: "I found 23 products in Clearance. Shall I proceed with 50% price reduction?"
User: "Yes"
Claude: Performs updates with progress tracking

3. Use Filters Effectively

Query with filters before operating:

  • Date ranges
  • Categories
  • Status (published, draft, pending, etc.)
  • Authors
  • Tags

Example:

code
# Good: Filtered operation
"Update all draft posts from last month to published"

# Avoid: Overly broad
"Update all posts"

WordPress Content Workflows

Blog Post Management

Creating Posts:

code
Use wordpress_create_post with:
- title: Clear, SEO-friendly title
- content: HTML content (can include images, formatting)
- status: draft (for review) or publish (immediate)
- excerpt: Short summary for feeds/previews
- categories: Array of category IDs
- tags: Array of tag IDs

Common Patterns:

  1. Draft → Review → Publish Workflow:

    code
    1. Create post with status: "draft"
    2. Review and edit content
    3. Update status to "publish"
    
  2. Scheduled Publishing:

    code
    Create post with future date in 'date' field
    Status automatically becomes "future"
    WordPress publishes at scheduled time
    
  3. Content Series:

    code
    Create category for series
    Tag all posts in series with series tag
    Link posts using custom fields or content
    

Bulk Operations:

  • Update all posts in category: Query by category, update in batch
  • Change author: Filter by current author, reassign to new author
  • Update excerpts: Query posts missing excerpts, generate and add
  • SEO optimization: Query by status, add/update meta descriptions

Page Management

Hierarchical Pages:

code
Parent Page (ID: 10)
├── Child Page 1 (parent: 10)
├── Child Page 2 (parent: 10)
└── Child Page 3 (parent: 10)
    └── Grandchild Page (parent: Child3_ID)

Creating Page Hierarchy:

code
1. Create parent page
2. Note parent page ID
3. Create child pages with parent: parent_id
4. Repeat for nested levels

Common Use Cases:

  • About section (About → Team, History, Mission)
  • Documentation (Docs → Getting Started, API Reference, Tutorials)
  • Service pages (Services → Web Design, SEO, Marketing)

Media Library Management

Uploading Media:

code
Upload files to media library
Get media ID for use in posts/pages
Update metadata (title, alt text, caption)

Organizing Media:

  • Use descriptive filenames before upload
  • Add alt text for accessibility and SEO
  • Use captions for context
  • Organize by upload date or manual folders (requires plugin)

Bulk Media Updates:

code
"Get all media without alt text"
"Update alt text for product images"
"Find unused media items"

Category & Tag Organization

Category Strategy:

  • Hierarchical (parent/child relationships)
  • Broad to specific (e.g., Technology → Web Development → JavaScript)
  • Limited number (5-10 top-level categories)
  • Every post should have a category

Tag Strategy:

  • Flat structure (no hierarchy)
  • Specific topics, keywords
  • More granular than categories
  • Multiple tags per post acceptable

Reorganization Workflow:

code
1. Audit current categories/tags
   "Show all categories with post counts"

2. Plan new structure
   Document mapping: Old Category → New Category

3. Create new categories
   Create hierarchy as needed

4. Migrate content
   Query posts in old category
   Bulk update to new category

5. Clean up
   Delete old unused categories

WooCommerce Workflows

Product Management

Product Types:

  • Simple: Single product, no variations (most common)
  • Variable: Product with variations (size, color, etc.)
  • Grouped: Collection of related products
  • External: Product hosted on another site
  • Virtual: No shipping required (services, digital downloads)
  • Downloadable: Digital product with file downloads

Creating Simple Product:

code
Use woocommerce_create_product with:
- name: Product name
- type: "simple"
- regular_price: "29.99"
- description: Full product description (HTML)
- short_description: Brief summary
- sku: Unique product identifier
- stock_quantity: Inventory count
- manage_stock: true (enable inventory tracking)
- categories: Array of product category IDs
- images: Array of image objects

Common Product Operations:

  1. Bulk Price Updates:

    code
    "Increase all products in 'Winter Collection' by 10%"
    Query products in category
    Calculate new prices
    Bulk update with new prices
    
  2. Inventory Management:

    code
    "Set stock for all t-shirts to 50"
    "Find all out-of-stock products"
    "Update SKUs for products missing them"
    
  3. Product Reorganization:

    code
    "Move all products from Old Category to New Category"
    Query products by category
    Update category assignment
    Verify migration
    
  4. Sale Pricing:

    code
    Create sale:
    - Set sale_price (lower than regular_price)
    - Set date_on_sale_from (start date)
    - Set date_on_sale_to (end date)
    
    End sale:
    - Remove sale_price
    - Clear sale dates
    

Order Processing

Order Statuses:

  • pending: Awaiting payment
  • processing: Payment received, preparing order
  • on-hold: Awaiting confirmation
  • completed: Order fulfilled
  • cancelled: Cancelled by admin/customer
  • refunded: Order refunded
  • failed: Payment failed

Order Workflow:

code
1. New Order (pending)
   ↓
2. Payment received (processing)
   ↓
3. Items picked & packed
   ↓
4. Shipped (add tracking)
   ↓
5. Delivered (completed)

Common Order Operations:

  1. Process Pending Orders:

    code
    "Show all pending orders"
    Review orders
    Update status to processing
    
  2. Bulk Status Updates:

    code
    "Mark all processing orders from last week as completed"
    Query orders by status and date
    Update status with notes
    
  3. Order Notes:

    code
    Update order with notes field:
    - "Added tracking: 1Z999AA10123456784"
    - "Customer requested gift wrap"
    - "Partial shipment sent"
    

Customer Management

Customer Data:

code
- email (unique identifier)
- first_name, last_name
- billing address
- shipping address
- total orders
- total spent

Common Customer Operations:

  1. Find Customers:

    code
    "Find customers who spent over $500"
    "Show customers with no orders in last 90 days"
    "List top 10 customers by total spent"
    
  2. Update Customer Info:

    code
    Update billing/shipping addresses
    Add customer notes
    Assign to customer groups (requires plugin)
    

Coupon Management

Creating Coupons:

code
Use woocommerce_create_coupon with:
- code: "SAVE20" (unique code)
- discount_type: "percent" or "fixed_cart"
- amount: "20" (20% or $20 depending on type)
- description: Internal description
- date_expires: Expiration date
- usage_limit: Max number of uses
- minimum_amount: Minimum cart amount

Coupon Strategies:

  1. Percentage Discounts:

    code
    discount_type: "percent"
    amount: "15" (15% off)
    
  2. Fixed Amount:

    code
    discount_type: "fixed_cart"
    amount: "10" ($ 10 off entire cart)
    
  3. Time-Limited Promotions:

    code
    Create coupon with date_expires
    Promote via email/social media
    Monitor usage
    Archive/delete after expiration
    

Bulk Operation Patterns

Safe Bulk Operations

Pattern: Query → Review → Backup → Execute → Verify

Example - Bulk Product Update:

code
1. Query affected items
   "Show all products in Clearance category"

2. Review list
   Verify correct products will be updated

3. Create backup
   "Create backup of these products"

4. Execute operation
   "Update all to 50% off regular price"

5. Verify results
   "Show updated products to confirm prices"

Batch Processing

For very large operations (100+ items):

code
Process in batches:
1. Query first 50 items
2. Update batch 1
3. Verify results
4. Query next 50 items
5. Update batch 2
6. Continue until complete

Benefits:

  • Easier to spot errors mid-process
  • Less risk of partial failures affecting everything
  • Can pause/resume if needed

Common Bulk Operations

  1. Category Migration:

    code
    Old Category → New Category
    1. List all posts/products in old category
    2. Create new category if needed
    3. Bulk update category assignment
    4. Verify migration
    5. Delete old category
    
  2. Price Updates:

    code
    Update all products matching criteria:
    1. Query products by filter
    2. Calculate new prices
    3. Backup products
    4. Bulk update prices
    5. Verify changes
    
  3. Status Changes:

    code
    Draft → Published, or Published → Private:
    1. Query items with current status
    2. Review list
    3. Bulk update status
    4. Verify changes
    

SEO and Content Optimization

SEO Workflow

For Each Post/Page:

code
1. Write compelling title (60 chars max)
2. Add meta description via excerpt (160 chars)
3. Use headings properly (H1, H2, H3)
4. Add alt text to all images
5. Internal linking (link to related posts)
6. Add categories and relevant tags
7. Set featured image

Bulk SEO Operations:

code
"Find all posts without excerpts"
"Generate excerpts for posts missing them"
"Find posts with no featured image"
"Update all image alt text in posts about [topic]"

Content Audit

Regular Audits:

code
1. Find outdated content
   "Show posts older than 2 years"

2. Find thin content
   "Find posts with less than 300 words"

3. Find missing metadata
   "Posts without categories"
   "Posts without featured images"

4. Find orphaned content
   "Pages not linked from anywhere"

Advanced Patterns

Content Migrations

Between Categories:

code
Source → Destination
1. Map old to new categories
2. Create new categories
3. Query content in old categories
4. Bulk update to new categories
5. Verify migration
6. Archive or delete old categories

Between Sites (using backups):

code
Site A → Site B
1. Backup content from Site A
2. Configure Site B
3. Restore backup to Site B
4. Adjust IDs and references
5. Verify migration

Custom Workflows

Product Launch:

code
1. Create products (status: draft)
2. Add images and descriptions
3. Set pricing and inventory
4. Review and verify all details
5. Create launch coupons
6. Schedule publish date
7. Update status to published

Sale Event:

code
Before sale:
1. Backup all products
2. Update sale prices
3. Set sale dates
4. Create sale coupons
5. Update featured products

After sale:
1. Remove sale prices
2. Archive/delete coupons
3. Revert featured products
4. Generate sales report

Error Handling

When Operations Fail:

code
1. Check error message
2. Verify credentials (/wc-wp:init to test)
3. Confirm item exists
4. Check permissions
5. Review API logs
6. Try single item instead of bulk
7. Restore from backup if needed

Common Errors:

  • Authentication failed → Regenerate credentials
  • Item not found → Verify ID is correct
  • Permission denied → Check API key permissions
  • Rate limiting → Slow down requests, batch smaller

Utility Scripts

This skill includes workflow automation scripts in scripts/:

  • bulk-price-update.js - Template for bulk pricing operations
  • category-migration.js - Migrate content between categories
  • content-audit.js - Audit content for issues
  • seo-optimization.js - Batch SEO improvements

Reference these scripts for automation of complex workflows.

Additional Resources

  • references/api-endpoints.md - Complete API endpoint reference
  • references/product-fields.md - All WooCommerce product fields explained
  • references/post-fields.md - All WordPress post fields explained
  • references/workflow-templates.md - Ready-to-use workflow templates
  • examples/bulk-operations.md - Example bulk operation commands
  • examples/migration-examples.md - Content migration examples

Remember: Always backup before bulk operations. The plugin auto-backs up deletions and bulk updates, but manual backups add extra safety.