Refactor SEO automation into unified CLI application
Major refactoring to create a clean, integrated CLI application: ### New Features: - Unified CLI executable (./seo) with simple command structure - All commands accept optional CSV file arguments - Auto-detection of latest files when no arguments provided - Simplified output directory structure (output/ instead of output/reports/) - Cleaner export filename format (all_posts_YYYY-MM-DD.csv) ### Commands: - export: Export all posts from WordPress sites - analyze [csv]: Analyze posts with AI (optional CSV input) - recategorize [csv]: Recategorize posts with AI - seo_check: Check SEO quality - categories: Manage categories across sites - approve [files]: Review and approve recommendations - full_pipeline: Run complete workflow - analytics, gaps, opportunities, report, status ### Changes: - Moved all scripts to scripts/ directory - Created config.yaml for configuration - Updated all scripts to use output/ directory - Deprecated old seo-cli.py in favor of new ./seo - Added AGENTS.md and CHANGELOG.md documentation - Consolidated README.md with updated usage ### Technical: - Added PyYAML dependency - Removed hardcoded configuration values - All scripts now properly integrated - Better error handling and user feedback Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
328
guides/EXPORT_POSTS_FOR_AI_DECISION.md
Normal file
328
guides/EXPORT_POSTS_FOR_AI_DECISION.md
Normal file
@@ -0,0 +1,328 @@
|
||||
# Export Posts for AI Decision Making - Complete Guide
|
||||
|
||||
## What This Script Does
|
||||
|
||||
Exports **ALL posts from all 3 WordPress sites** with complete details to CSV, so you can:
|
||||
1. Upload to Claude or other AI for analysis
|
||||
2. Get AI recommendations for:
|
||||
- Which site each post should be on
|
||||
- Which posts to consolidate (duplicates)
|
||||
- Which posts to delete (low-traffic)
|
||||
- Content gaps to fill
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
python scripts/export_posts_for_ai_decision.py
|
||||
```
|
||||
|
||||
**Output:** `output/reports/all_posts_for_ai_decision_TIMESTAMP.csv`
|
||||
|
||||
---
|
||||
|
||||
## What Gets Exported
|
||||
|
||||
### For Each Post:
|
||||
- **Site**: Which website it's on (mistergeek.net, webscroll.fr, hellogeek.net)
|
||||
- **Post ID**: WordPress ID
|
||||
- **Status**: Published or Draft
|
||||
- **Title**: Post title
|
||||
- **URL**: Full post URL
|
||||
- **Dates**: Published and modified dates
|
||||
- **Categories & Tags**: Current categorization
|
||||
- **Content Preview**: First 500 characters (for context)
|
||||
- **Excerpt**: Post excerpt
|
||||
- **SEO Data**:
|
||||
- Rank Math title
|
||||
- Meta description
|
||||
- Focus keyword
|
||||
- **Word Count**: Content length
|
||||
|
||||
---
|
||||
|
||||
## Complete Workflow
|
||||
|
||||
### Step 1: Export All Posts
|
||||
|
||||
```bash
|
||||
python scripts/export_posts_for_ai_decision.py
|
||||
```
|
||||
|
||||
**Output:**
|
||||
```
|
||||
=======================================================================
|
||||
EXPORTING ALL POSTS FOR AI DECISION MAKING
|
||||
=======================================================================
|
||||
|
||||
mistergeek.net:
|
||||
Total: 328
|
||||
Published: 266
|
||||
Drafts: 62
|
||||
|
||||
webscroll.fr:
|
||||
Total: 17
|
||||
Published: 13
|
||||
Drafts: 4
|
||||
|
||||
hellogeek.net:
|
||||
Total: 23
|
||||
Published: 20
|
||||
Drafts: 3
|
||||
|
||||
───────────────────────────────────────────────────────────────────
|
||||
Total across all sites: 368 posts
|
||||
Published: 299
|
||||
Drafts: 69
|
||||
───────────────────────────────────────────────────────────────────
|
||||
|
||||
✓ CSV file: output/reports/all_posts_for_ai_decision_20260216_150000.csv
|
||||
```
|
||||
|
||||
### Step 2: Open CSV and Review
|
||||
|
||||
```bash
|
||||
open output/reports/all_posts_for_ai_decision_*.csv
|
||||
```
|
||||
|
||||
You'll see all posts with their full details in a spreadsheet format.
|
||||
|
||||
### Step 3: Upload to AI for Analysis
|
||||
|
||||
**Option A: Claude (Recommended)**
|
||||
1. Copy the CSV file path
|
||||
2. Open https://claude.ai
|
||||
3. Paste the CSV content or upload the file
|
||||
4. Ask Claude to analyze and recommend:
|
||||
```
|
||||
Please analyze this CSV of blog posts and:
|
||||
1. Categorize each by topic (VPN, software, gaming, torrenting, streaming, etc.)
|
||||
2. Recommend which website each should be on:
|
||||
- mistergeek.net: High-value (VPN, software, gaming, tech guides)
|
||||
- webscroll.fr: Torrenting/file-sharing content
|
||||
- hellogeek.net: Low-traffic, experimental, off-brand
|
||||
3. Identify duplicate/similar posts that should be consolidated
|
||||
4. Flag posts for deletion (very low word count or clearly spam)
|
||||
5. Provide a CSV with recommendations
|
||||
```
|
||||
|
||||
**Option B: ChatGPT**
|
||||
1. Upload CSV file
|
||||
2. Ask same analysis questions
|
||||
|
||||
**Option C: Google Sheets + Claude**
|
||||
1. Import CSV to Google Sheets
|
||||
2. Add column: "AI Recommendation"
|
||||
3. Use Claude to fill in recommendations
|
||||
4. Share sheet with team for decisions
|
||||
|
||||
### Step 4: Create Master Decision Spreadsheet
|
||||
|
||||
Based on AI recommendations, create a master sheet with decisions:
|
||||
|
||||
| Site | Post ID | Title | Current Site | Recommended | Action | Priority | Notes |
|
||||
|------|---------|-------|--------------|------------|--------|----------|-------|
|
||||
| mistergeek.net | 2845 | Best VPN 2025 | mistergeek | mistergeek | KEEP | High | High traffic, optimize |
|
||||
| mistergeek.net | 1234 | YggTorrent Guide | mistergeek | webscroll.fr | MOVE | Medium | Torrent content |
|
||||
| mistergeek.net | 5678 | Random Post | mistergeek | hellogeek | MOVE | Low | Very low traffic |
|
||||
| webscroll.fr | 100 | Tracker Guide | webscroll | webscroll | KEEP | High | Core content |
|
||||
|
||||
### Step 5: Execute Moves
|
||||
|
||||
```bash
|
||||
# Week 1: Move posts to webscroll.fr
|
||||
# Week 2: Move posts to hellogeek.net
|
||||
# Week 3-4: Consolidate duplicates
|
||||
# Week 5: Optimize remaining posts on mistergeek.net
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CSV Columns Explained
|
||||
|
||||
### Identification
|
||||
- **site**: Current website
|
||||
- **post_id**: WordPress post ID
|
||||
- **status**: "publish" or "draft"
|
||||
|
||||
### Content
|
||||
- **title**: Post title
|
||||
- **slug**: URL slug
|
||||
- **url**: Full post URL
|
||||
- **excerpt**: Short excerpt if available
|
||||
- **content_preview**: First 500 characters of post content (for topic analysis)
|
||||
- **word_count**: Number of words in post
|
||||
|
||||
### Metadata
|
||||
- **date_published**: When published
|
||||
- **date_modified**: Last update
|
||||
- **author_id**: Post author
|
||||
- **categories**: WordPress categories
|
||||
- **tags**: WordPress tags
|
||||
|
||||
### SEO
|
||||
- **seo_title**: Rank Math SEO title
|
||||
- **meta_description**: Rank Math or Yoast meta description
|
||||
- **focus_keyword**: Primary keyword
|
||||
|
||||
---
|
||||
|
||||
## AI Prompt Examples
|
||||
|
||||
### Prompt 1: Basic Categorization
|
||||
|
||||
```
|
||||
I have a CSV of 368 blog posts from 3 websites. Please:
|
||||
|
||||
1. Categorize each post by PRIMARY topic:
|
||||
- VPN
|
||||
- Software/Tools
|
||||
- Gaming
|
||||
- Streaming
|
||||
- Torrenting
|
||||
- File-Sharing
|
||||
- General Tech
|
||||
- Other
|
||||
|
||||
2. For each post, recommend which site it should be on:
|
||||
- mistergeek.net: VPN, Software, Gaming, General Tech (high-value)
|
||||
- webscroll.fr: Torrenting, File-Sharing (niche audience)
|
||||
- hellogeek.net: Other, low-traffic experimental content
|
||||
|
||||
3. Return a CSV with columns:
|
||||
post_id, current_site, title, recommended_site, topic, reason
|
||||
```
|
||||
|
||||
### Prompt 2: Identify Duplicates
|
||||
|
||||
```
|
||||
Please identify posts that cover the same or very similar topics:
|
||||
|
||||
1. Group similar posts together
|
||||
2. For each group, identify which is the best (highest quality, most traffic)
|
||||
3. Recommend keeping the best and consolidating others into it
|
||||
4. Suggest which posts to delete vs merge
|
||||
|
||||
Return: List of duplicate groups with consolidation recommendations
|
||||
```
|
||||
|
||||
### Prompt 3: Strategic Recommendations
|
||||
|
||||
```
|
||||
Based on this data, provide strategic recommendations for:
|
||||
|
||||
1. Which topics are over-represented?
|
||||
2. Which topics are under-represented?
|
||||
3. What content gaps exist?
|
||||
4. Which low-traffic posts should be deleted?
|
||||
5. What new content should be created?
|
||||
6. How to optimize each site's focus?
|
||||
|
||||
Consider SEO benefits of topic consolidation and site specialization.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Using AI Recommendations
|
||||
|
||||
Once you get AI recommendations:
|
||||
|
||||
1. **Create master spreadsheet** in Google Sheets with all decisions
|
||||
2. **Share with team** for final approval
|
||||
3. **Document assumptions** (e.g., "Traffic = quality indicator")
|
||||
4. **Plan execution** by priority and complexity
|
||||
5. **Execute moves** following the [MULTI_SITE_STRATEGY.md](MULTI_SITE_STRATEGY.md) guide
|
||||
|
||||
---
|
||||
|
||||
## Expected CSV Size
|
||||
|
||||
- **368 posts** = ~150-200 KB CSV file
|
||||
- Can be opened in:
|
||||
- Excel
|
||||
- Google Sheets
|
||||
- Apple Numbers
|
||||
- Any text editor
|
||||
|
||||
---
|
||||
|
||||
## Command Options
|
||||
|
||||
```bash
|
||||
# Basic usage (default)
|
||||
python scripts/export_posts_for_ai_decision.py
|
||||
|
||||
# Custom output location
|
||||
python scripts/export_posts_for_ai_decision.py --output /path/to/my_export.csv
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Example AI Response Format
|
||||
|
||||
When you ask Claude to analyze, it might return:
|
||||
|
||||
```csv
|
||||
post_id,current_site,title,recommended_site,topic,action,reason
|
||||
2845,mistergeek.net,Best VPN 2025,mistergeek.net,VPN,KEEP,High traffic + relevance
|
||||
1234,mistergeek.net,YggTorrent Guide,webscroll.fr,Torrenting,MOVE,Belongs in torrent-focused site
|
||||
5678,mistergeek.net,Random Niche,hellogeek.net,Other,MOVE,Very low traffic + off-brand
|
||||
...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Include context in prompts**: Tell AI your goal (improve SEO, consolidate authority)
|
||||
2. **Ask for reasoning**: "Why should this post move?"
|
||||
3. **Use multiple analyses**: Get 2-3 different recommendations and compare
|
||||
4. **Manual review**: Don't blindly follow AI, use it to inform your decisions
|
||||
5. **Test incrementally**: Move a few high-confidence posts first, measure impact, then scale
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Run export:**
|
||||
```bash
|
||||
python scripts/export_posts_for_ai_decision.py
|
||||
```
|
||||
|
||||
2. **Upload CSV to Claude:**
|
||||
- Open https://claude.ai
|
||||
- Upload CSV file or paste content
|
||||
- Ask for categorization and site recommendations
|
||||
|
||||
3. **Review AI output** and create master decision spreadsheet
|
||||
|
||||
4. **Execute moves** following MULTI_SITE_STRATEGY.md guide
|
||||
|
||||
5. **Monitor results** for 30 days in Google Analytics
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "No posts found"
|
||||
- Check credentials in .env
|
||||
- Verify WordPress sites are online
|
||||
- Try running diagnostic: `python scripts/multi_site_seo_analyzer.py --diagnose https://www.mistergeek.net`
|
||||
|
||||
### "Authentication failed"
|
||||
- Verify username and app password in .env
|
||||
- Check user has read permission
|
||||
- Re-generate app password in WordPress
|
||||
|
||||
### CSV is empty or missing columns
|
||||
- Check that WordPress REST API is returning data
|
||||
- Verify Rank Math plugin is active (for SEO fields)
|
||||
- Check for errors in terminal output
|
||||
|
||||
---
|
||||
|
||||
Ready to export and analyze? Run:
|
||||
```bash
|
||||
python scripts/export_posts_for_ai_decision.py
|
||||
```
|
||||
Reference in New Issue
Block a user