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>
7.2 KiB
Install Rank Math API Manager Extended - Complete Guide
What This Plugin Does
This extended version of the Rank Math API Manager plugin adds GET endpoints to read Rank Math SEO metadata (the original only had POST for updating).
New GET Endpoints
GET /wp-json/rank-math-api/v2/get-meta/{post_id}
→ Retrieve Rank Math meta for a single post
GET /wp-json/rank-math-api/v2/posts?per_page=100&page=1&status=publish
→ Retrieve all posts with their Rank Math meta (paginated)
POST /wp-json/rank-math-api/v2/update-meta
→ Update Rank Math meta (original functionality)
Installation
Option 1: Install from File (Easiest)
Step 1: Download the Plugin File
The plugin file is at:
/Users/acid/Documents/seo/wordpress-plugins/rank-math-api-manager-extended.php
Step 2: Upload to WordPress
- Download the file
- In WordPress Admin:
Plugins → Add New → Upload Plugin - Select file:
rank-math-api-manager-extended.php - Click: Install Now
- Click: Activate Plugin
Option 2: Install Manually via FTP
- Connect to your server via FTP
- Navigate to:
/wp-content/plugins/ - Create folder:
rank-math-api-manager-extended - Upload
rank-math-api-manager-extended.phpto that folder - In WordPress Admin: Plugins → Activate "Rank Math API Manager Extended"
Option 3: Install via SSH/Command Line
# SSH into your server
cd /path/to/wordpress/wp-content/plugins/
# Create plugin folder
mkdir rank-math-api-manager-extended
# Upload file (if you have it locally)
# Or create it directly:
cat > rank-math-api-manager-extended/rank-math-api-manager-extended.php << 'EOF'
[Paste the entire plugin code here]
EOF
# Then activate in WordPress Admin
Verify Installation
Step 1: Check Plugin is Activated
In WordPress Admin:
Plugins → Installed Plugins
Look for: "Rank Math API Manager Extended"
Status: Should say "Active"
Step 2: Test the GET Endpoint
Run this curl command (replace credentials and domain):
curl -u "your_username:your_app_password" \
"https://www.mistergeek.net/wp-json/rank-math-api/v2/posts?per_page=1&status=publish"
You should see:
[
{
"id": 2845,
"title": "Best VPN Services 2025",
"slug": "best-vpn-services",
"url": "https://www.mistergeek.net/best-vpn-services/",
"status": "publish",
"rank_math_title": "The Best VPN Services 2025",
"rank_math_description": "Discover the best VPN services...",
"rank_math_focus_keyword": "best VPN",
"rank_math_canonical_url": ""
}
]
If you see this: ✓ SUCCESS!
Step 3: Run Diagnostic
python scripts/multi_site_seo_analyzer.py --diagnose https://www.mistergeek.net
You should now see:
Available meta fields:
• rank_math_description: Discover the best VPN...
• rank_math_title: The Best VPN Services 2025
• rank_math_focus_keyword: best VPN
Available API Endpoints
1. GET Single Post Meta
curl -u "username:password" \
"https://www.mistergeek.net/wp-json/rank-math-api/v2/get-meta/2845"
Response:
{
"post_id": 2845,
"post_title": "Best VPN Services 2025",
"post_url": "https://www.mistergeek.net/best-vpn-services/",
"rank_math_title": "The Best VPN Services 2025",
"rank_math_description": "Discover the best VPN services...",
"rank_math_focus_keyword": "best VPN",
"rank_math_canonical_url": ""
}
2. GET All Posts (Paginated)
curl -u "username:password" \
"https://www.mistergeek.net/wp-json/rank-math-api/v2/posts?per_page=100&page=1&status=publish"
Query Parameters:
per_page- Number of posts per page (1-100, default: 100)page- Page number (default: 1)status- Post status: publish, draft, pending, trash (default: publish)
Response: Array of posts with meta fields
3. POST Update Meta
curl -u "username:password" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"post_id": 2845,
"rank_math_title": "New Title",
"rank_math_description": "New description"
}' \
"https://www.mistergeek.net/wp-json/rank-math-api/v2/update-meta"
Update the SEO Analyzer Script
Now that the plugin is installed, update the script to use the new endpoint:
File: /Users/acid/Documents/seo/scripts/multi_site_seo_analyzer.py
The script should automatically detect the meta fields from the REST API response. Just run:
python scripts/multi_site_seo_analyzer.py --include-drafts --top-n 50
The meta descriptions will now be fetched from Rank Math!
Install on All 3 Sites
Repeat the same installation steps for:
- mistergeek.net ← Install here first to test
- webscroll.fr
- hellogeek.net
For each site:
- Upload plugin via WordPress Admin
- Activate plugin
- Test with curl command
- Run diagnostic
Troubleshooting
"Plugin could not be activated"
Solutions:
- Check PHP syntax:
php -l rank-math-api-manager-extended.php - Ensure
/wp-content/plugins/folder exists and is writable - Check WordPress error log:
/wp-content/debug.log
"Endpoint not found" (404)
Solutions:
- Verify plugin is activated
- Verify correct URL:
/wp-json/rank-math-api/v2/posts(not v1) - Flush WordPress rewrite rules:
WordPress Admin → Settings → Permalinks → Save Changes
"Unauthorized" (401)
Solutions:
- Verify credentials (username and app password)
- Verify user has
read_postspermission (at least Author role) - Check if security plugin is blocking REST API
"No meta fields returned"
Solutions:
- Verify Rank Math SEO is installed and activated
- Verify posts have Rank Math meta set (check in WordPress editor)
- Check WordPress database:
wp_postmetatable hasrank_math_*entries
Security Notes
This plugin respects WordPress permissions:
- Read access: Requires
read_postscapability (any logged-in user) - Write access: Requires
edit_postscapability (Author or higher) - Uses HTTP Basic Auth (same as original)
For production, consider:
- Using HTTPS only (not HTTP)
- Restricting API access by IP in
.htaccessor security plugin - Creating a separate API user with limited permissions
Remove Plugin
If you need to uninstall:
- In WordPress Admin: Plugins → Deactivate "Rank Math API Manager Extended"
- Delete the plugin folder:
/wp-content/plugins/rank-math-api-manager-extended/ - Original Rank Math SEO still works
Next Steps
- Install the plugin on mistergeek.net
- Test with curl:
curl -u "username:password" \ "https://www.mistergeek.net/wp-json/rank-math-api/v2/posts?per_page=1" - Run diagnostic:
python scripts/multi_site_seo_analyzer.py --diagnose https://www.mistergeek.net - Run analyzer:
python scripts/multi_site_seo_analyzer.py --include-drafts --top-n 50 - Install on other 2 sites and repeat
Support
If you encounter issues:
- Check the troubleshooting section above
- Verify curl command works (tests plugin directly)
- Check WordPress debug log:
/wp-content/debug.log - Share the error message and we can debug together
Ready to install? Download the plugin file and upload it! 🚀