84EM needed to establish a WordPress development service presence in every US market without manually creating hundreds of unique, SEO-optimized pages. Manual content creation for 350 location-specific landing pages would take months and require constant updates to maintain consistency and avoid duplicate content penalties.
Solution
The plugin integrates Claude AI’s API with WordPress through WP-CLI commands, automatically generating unique content for all 50 US states and their major cities. It creates a hierarchical structure where each state serves as a parent page with six child city pages, establishing clean URLs like /wordpress-development-services-california/los-angeles/ that reinforce geographic relevance.
Content generation uses structured prompts that incorporate location-specific details, including state names, city lists, and service keywords. This ensures each page provides genuine local context rather than templated filler. The system automatically interlinks related pages, linking city names to their respective pages and service keywords to relevant service pages through intelligent fuzzy matching that handles variations in AI-generated text.
The plugin includes safeguards that prevent linking errors, protect hardcoded content structure, and prevent nested links that could break SEO value. Content is generated in proper WordPress block editor format with structured headings, lists, and call-to-action blocks that can be edited through the standard WordPress interface.
Technical Implementation
Built with modern PHP architecture using PSR-4 autoloading and dependency injection, the plugin organizes functionality into distinct layers for API communication, CLI command handling, content generation, data provision, schema creation, and content processing. API keys are stored with AES-256-CBC encryption using WordPress security salts, ensuring credentials remain protected in the database.
The system dynamically fetches available Claude models from Anthropic’s API, allowing administrators to select the latest models via an interactive CLI interface. Each model selection is validated with a test API call before being saved, confirming access permissions and functionality. Content generation includes automatic retry logic with exponential backoff, handling transient errors gracefully while respecting rate limits.
Fuzzy keyword matching ensures comprehensive link coverage by detecting service keyword variations within AI-generated content and selecting the most specific match when multiple options exist. The content processor splits text by HTML tags before matching to prevent linking text inside attributes, while placeholder replacement protects list items with bolded headings from automatic modification.
Each page includes the LocalBusiness schema with location-specific service areas. State pages define service coverage across the entire state, including major cities, while city pages specify exact city locations within the parent state context. SEO metadata follows consistent patterns, with optimized titles and descriptions that incorporate location-specific keywords.
The plugin includes 82 integration tests across 10 test suites using a custom WP-CLI-based testing framework. Tests use real WordPress functions, real database operations, and real API calls rather than mocks, properly cleaning up test data while maintaining complete isolation through prefixed option names. GitHub Actions workflows handle automated deployments with pre-deployment validation, security scanning, automatic backups, health check verification, and automatic rollback on failure.
Results
The plugin successfully generates 350 unique pages covering all 50 US states and 300 major cities with consistent quality and genuine local relevance. Each page targets specific geographic keywords while maintaining hierarchical relationships and automated interlinking that distributes SEO value across the site.
Bulk operations complete in hours rather than weeks, with a single command generating all location pages, including proper schema, metadata, and interlinking. The WP-CLI interface enables quick updates across all pages when service offerings change or content strategies evolve, with commands that refresh keyword links or regenerate schema without touching content or making additional API calls.
The modular architecture provides maintainable code that can be extended with new features, while comprehensive test coverage ensures reliability across updates. Automated deployment workflows with health checks and automatic rollback capabilities enable confident releases across development, staging, and production environments.
View the source code and documentation on GitHub.
