Complete step-by-step walkthrough for fixing 558 duplicate meta descriptions using FREE Google Gemini Flash API.
Before starting, verify:
AIza...)No credit card required. Completely FREE forever.
Open PowerShell in C:\dev\itblogpros\:
cd C:\dev\itblogpros
npm install @google/generative-ai gray-matter fs-extra
Expected output:
added 15 packages in 8s
Option A: Environment Variable (Recommended)
PowerShell:
$env:GEMINI_API_KEY="your-api-key-here"
CMD:
set GEMINI_API_KEY=your-api-key-here
Option B: Hardcode in Script
Edit generate-meta-descriptions-gemini.js line 28:
const genAI = new GoogleGenerativeAI('AIza_your_key_here');
node generate-meta-descriptions-gemini.js --test
Expected: Processes one post successfully.
node validate-meta-descriptions.js
Expected output:
Validating 558 posts...
❌ Missing descriptions: 0
⚠️ Using default description: 300+
⚠️ Duplicate descriptions: 558
Total issues: 858
node check-url-duplicates.js
Expected: Shows URL pattern issues.
node generate-meta-descriptions-gemini.js --test
Expected output:
[2025-11-28T10:30:00.000Z] Meta Description Generator v2.0 - Started
[2025-11-28T10:30:00.100Z] TEST MODE: Processing single post
[2025-11-28T10:30:05.200Z] [1/1] Processing: 2025-01-15-wifi-7.md
[2025-11-28T10:30:05.800Z] API call 1: Generating for "WiFi 7 vs WiFi 6..."
[2025-11-28T10:30:07.200Z] ✓ Generated (145 chars): Discover if WiFi 7...
[2025-11-28T10:30:07.300Z] [DRY RUN] Would update: 2025-01-15-wifi-7.md
✓ Successfully generated: 1
⊘ Skipped: 0
✗ Errors: 0
Verify:
node generate-meta-descriptions-gemini.js --limit=10
Expected: Processes 10 posts in ~1 minute (dry run).
Check quality:
node generate-meta-descriptions-gemini.js --test --write
Expected: Actually updates one post file.
Verify file changed:
Get-Content posts\2025-01-15-wifi-7-vs-wifi-6.md | Select-String "description"
Copy-Item -Path posts -Destination posts-backup-$(Get-Date -Format 'yyyy-MM-dd') -Recurse
node generate-meta-descriptions-gemini.js --write
Expected:
Console output:
[2025-11-28T10:30:00.000Z] Processing 558 posts...
[2025-11-28T10:30:05.200Z] [1/558] Processing: 2025-01-15-wifi-7.md
[2025-11-28T10:30:07.300Z] ✓ Updated: 2025-01-15-wifi-7.md
[2025-11-28T10:30:12.800Z] [2/558] Processing: 2025-01-16-smart-home.md
[2025-11-28T10:30:13.500Z] ⊘ Skipped - already has good description
[2025-11-28T10:35:00.000Z] Checkpoint saved: 50 posts completed
... continues ...
[2025-11-28T10:42:00.000Z] SUMMARY
[2025-11-28T10:42:00.000Z] ✓ Successfully generated: 408
[2025-11-28T10:42:00.000Z] ⊘ Skipped: 150
[2025-11-28T10:42:00.000Z] ✗ Errors: 0
[2025-11-28T10:42:00.000Z] 💰 Cost: $0.00
Watch for:
If interrupted:
node generate-meta-descriptions-gemini.js --resume --write
node validate-meta-descriptions.js
Expected output:
Validating 558 posts...
✅ All meta descriptions are valid!
Total issues: 0
View sample descriptions:
Get-Content posts\2025-01-15-wifi-7-vs-wifi-6.md | Select-String "description"
Get-Content posts\2025-01-16-ai-home-assistants.md | Select-String "description"
Get-Content posts\2021-03-23-improve-virgin-media-wifi.md | Select-String "description"
Verify:
CRITICAL: This prevents future duplicate issues.
Edit C:\dev\itblogpros\posts\posts.json:
{
"layout": "layout.njk",
"tags": "post",
"permalink": "/posts/IMPLEMENTATION-GUIDE-GEMINI/"
}
Create C:\dev\itblogpros\_redirects:
/2025/:month/:day/* /posts/2025-:month-:day-:splat 301
/2024/:month/:day/* /posts/2024-:month-:day-:splat 301
/2023/:month/:day/* /posts/2023-:month-:day-:splat 301
/2022/:month/:day/* /posts/2022-:month-:day-:splat 301
/2021/:month/:day/* /posts/2021-:month-:day-:splat 301
/priority-meta-backups/* /posts/:splat 301
Add to .eleventy.js:
// Copy _redirects to output
eleventyConfig.addPassthroughCopy("_redirects");
npx @11ty/eleventy
Verify _redirects copied:
Test-Path _site\_redirects
# Should return: True
After deployment, test old URLs redirect to new:
/2025/01/15/wifi-7-vs-wifi-6/ → /posts/2025-01-15-wifi-7-vs-wifi-6//2024/03/10/old-post/ → /posts/2024-03-10-old-post/git status
git add .
git commit -m "Fix: Generated unique meta descriptions for all 558 posts + URL consolidation"
git push origin main
Expected: Cloudflare Pages auto-deploys.
Site should auto-generate, or manually:
npx @11ty/eleventy
https://itblogpros.com/sitemap.xmlIn Bing Webmaster Tools:
Solution:
npm install @google/generative-ai gray-matter fs-extra
Solution:
$env:GEMINI_API_KEY="your-key-here"
Or edit line 28 in script.
Solution: Script handles automatically. If persists:
--resume --writeSolution:
meta-generation.log for detailsnode generate-meta-descriptions-gemini.js --resume --writeSolution:
Solution:
del .meta-generation-progress.json
node generate-meta-descriptions-gemini.js --write
Starts fresh. Safe to do.
| Phase | Time | Activity |
|---|---|---|
| Setup | 5 min | API key + dependencies |
| Validation | 2 min | Check current state |
| Test Run | 3 min | Verify quality |
| Generation | 12 min | Process all 558 posts |
| Validation | 2 min | Verify results |
| URL Fix | 5 min | Consolidate URLs |
| Deploy | 3 min | Commit + push |
| SEO | 2 min | Submit sitemap |
| Total | 34 min | End-to-end |
Actual processing: 12 minutes
Setup/validation: 22 minutes
Cost: $0.00
✅ Immediate:
✅ Week 1:
✅ Month 1:
Review:
meta-generation.log for details.meta-generation-progress.json for statusCheck:
ENHANCED-FEATURES-GUIDE.md for feature detailsSTART-HERE.md for quick reference🎉 You're ready to implement! Follow these steps in order, and you'll have 558 unique, SEO-optimized meta descriptions in about 34 minutes total (12 minutes of actual processing).
Cost: $0.00 | Impact: Moderate to Significant | Difficulty: Easy