Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Example 04: WordPress SEO Automation at Scale

The problem

Proportione manages a WordPress site with 97+ blog posts, multiple standalone PHP pages, and a complex SEO structure. Managing all of this through the WordPress admin UI would be painfully slow and error-prone.

What we automated with Claude Code

Content management via WP-CLI

Instead of the WordPress editor, we manage content through SSH + WP-CLI:

# Create a post
wp post create --post_type=post --post_title="Title" --post_content="$(cat post.html)" --post_status=publish

# Update Yoast SEO metadata
wp post meta update $POST_ID _yoast_wpseo_title "SEO Title"
wp post meta update $POST_ID _yoast_wpseo_metadesc "Meta description"
wp post meta update $POST_ID _yoast_wpseo_focuskw "target keyword"

# Assign categories
wp post term set $POST_ID category "transformacion-digital"

# Flush cache after changes
wp cache flush && wp sg purge

Claude Code executes these commands over SSH, maintaining context of the entire site structure.

Bulk internal linking

Internal links are critical for SEO. With 9 new cluster posts + 6 service pages, we needed 35+ bidirectional links. Manual linking would take days.

Claude Code wrote a PHP script that:

  1. Searches for exact anchor text in existing posts
  2. Appends the link if the text exists and the link isn't already there
  3. Is idempotent — running it twice doesn't create duplicate links
  4. Executes via wp eval-file in a single SSH session

Content consolidation

97 posts with significant topic overlap. Claude Code identified consolidation candidates:

Group Posts Action
ChatGPT comparisons ~8 posts Merged into 1 guide
OpenAI news/drama ~5 posts Merged into 1 timeline
AI risks/AGI ~4 posts Merged into 1 enterprise post
AI regulation ~3 posts Merged into 1 EU guide

Result: 21 posts consolidated or redirected (301), improving crawl budget and topical authority.

Schema markup automation

Three custom PHP files handle structured data across the site:

  • proportione-article-schema.php — Article + BreadcrumbList for all blog posts (automatic)
  • proportione-seo-meta.php — Service schema for standalone pages
  • proportione-wpghost-seo-fix.php — Meta fixes for WordPress-generated pages

Claude Code wrote all three, deployed them via SSH, and verified the output with Google's Rich Results Test.

Google Search Console automation

After publishing, URLs need to be submitted for indexing. Claude Code uses Playwright MCP to:

  1. Navigate to GSC URL Inspection
  2. Submit each new URL
  3. Respect the daily quota (~7-10 submissions/day)

The workflow

Claude Code session
  │
  ├── Read CLAUDE.md (knows SSH access, WP-CLI patterns, schema structure)
  ├── Analyze GSC data (keyword gaps, performance)
  ├── Write content (HTML with inline styles for WP)
  ├── Deploy via SSH + WP-CLI
  ├── Run internal linking script
  ├── Set Yoast metadata
  ├── Flush cache
  └── Submit to GSC via Playwright MCP

All of this happens in a single conversation. Claude Code maintains context of every post ID, every URL, every link relationship.

Key takeaway

WordPress doesn't have to be slow. With SSH access and the right CLAUDE.md, Claude Code turns WordPress management into a programmatic operation — publishing, linking, optimizing, and submitting at the speed of conversation.