AI-powered CTR optimization system for WordPress sites using Google Search Console data.
This system automatically:
- Discovers underperforming pages from Google Search Console
- Analyzes CTR gaps based on position-adjusted benchmarks
- Generates AI-powered title improvements using Claude
- Implements changes via WordPress/RankMath API
- Measures results and learns from outcomes
- Reports monthly progress via email
- Monthly Analysis: Queries GSC for all pages, calculates expected CTR by position
- Gap Detection: Finds pages underperforming by 5%+ with sufficient impact
- AI Ideation: Generates 10 title variations per page using historical learnings
- Implementation: Publishes best title via RankMath API
- Measurement: Tracks results over 21-90 days
- Learning: Stores outcomes to improve future recommendations
- Threshold-Based: Optimizes ALL pages meeting criteria (not fixed limits)
- Position-Adjusted: Benchmarks based on actual SERP position
- Historical Tracking: Preserves GSC data beyond 16-month window
- Automatic Discovery: No manual page registration needed
- Self-Improving: Learns which title types work best for your site
# Clone the repo
git clone https://github.com/yourusername/Click-Through-Rate-Optimizer.git
cd Click-Through-Rate-Optimizer
# Install dependencies
pip install -r requirements.txt
# Install Claude CLI (for AI ideation)
npm install -g @anthropic-ai/claude-code
# Set up configuration
cp .env.example .env
# Edit .env with your site detailsSee docs/SETUP.md for detailed setup instructions.
Required:
- WordPress site with RankMath SEO plugin
- Google Search Console property
- Claude Code subscription (for AI ideation)
# Run monthly CTR optimization review
python scripts/ctr_orchestrator.py
# Log historical GSC data (run weekly via cron)
python scripts/log_gsc_data.py --days 7
# Evaluate ongoing experiments
python scripts/ctr_orchestrator.py --evaluate-onlyctr_system/ # Core modules
βββ config.py # Configuration and thresholds
βββ database.py # SQLite database operations
βββ gsc_client.py # Google Search Console API
βββ analysis.py # CTR gap analysis
βββ ideation.py # AI-powered title generation
βββ implementation.py # WordPress/RankMath API
βββ measurement.py # Experiment evaluation
βββ notifications.py # Email/Slack reporting
βββ schema.sql # Database schema
scripts/ # Executable scripts
βββ ctr_orchestrator.py # Main monthly workflow
βββ log_gsc_data.py # Historical data logger
Uses SQLite with tables for:
monthly_reviews- Review trackinggsc_page_metrics- Page performance snapshotsctr_experiments- A/B test trackingctr_benchmarks- Position-based expectationsgsc_page_tracking- Page discovery datesgsc_historical_data- Long-term data preservationseo_changes- Change history for publishing pipeline integration
Each site gets its own:
.envfile (site-specific config)site_crawl.db(isolated data)CTR_Reports/directory (reports)
See docs/SETUP.md for multi-site deployment strategies.
MIT
Built by Dan Cumberland for The Meaning Movement