Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/livvux/rankmath-ai-freedom/archive/refs/heads/main.zipBreak free from RankMath's proprietary Content AI system!
Use your own AI providers (OpenAI, Anthropic, OpenRouter) with RankMath SEO instead of being locked into their expensive credit system.
Features
- ✅ Full AI Feature Support: All RankMath Content AI features work with your own providers
- 🔓 Multiple Providers: Choose between OpenAI, Anthropic, or OpenRouter
- 💰 Cost Control: Pay only for what you use with your own API keys
- ∞ Unlimited Credits: Mock unlimited credits in RankMath UI
- 🚫 No Upsells: Suppress all RankMath Content AI upgrade notices
- 🎨 Vision Support: Image alt text generation using vision-capable models
- ⚡ Fast & Reliable: Direct API calls to your chosen provider
Supported Features
Core SEO Features
| Feature | Status |
|---|---|
| SEO Title Generation | ✅ |
| Meta Description Generation | ✅ |
| Image Alt Text (Vision) | ✅ |
| Bulk SEO Meta Generation | ✅ |
| Keyword Research | ✅ |
| Unlimited Credits Display | ✅ |
Content AI Features (46+ Tools)
| Category | Features |
|---|---|
| Blog Content | Post Ideas, Outlines, Introductions, Conclusions, Long-form |
| SEO Content | Titles, Descriptions, Meta, Headlines, OpenGraph |
| Marketing | AIDA, BAB, PAS, IDCA, HERO, SPIN frameworks |
| Social Media | Tweet, Facebook, Instagram, YouTube |
| Product | Descriptions, Reviews, Pros/Cons |
| Communication | Email, Reply, Comment |
| Other | FAQ, Bio, Job Description, Testimonial, Recipe |
Interactive Features
| Feature | Status |
|---|---|
| AI Chat | ✅ |
| Write/Improve/Expand | ✅ |
| Text Summarizer | ✅ |
| Paragraph Rewriter | ✅ |
| Grammar Fixer | ✅ |
Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher
- RankMath SEO plugin (free or pro)
- API key from one of:
- OpenAI (https://platform.openai.com/api-keys)
- Anthropic (https://console.anthropic.com/settings/keys)
- OpenRouter (https://openrouter.ai/keys)
Installation
- Download or clone this repository
- Upload the
rankmath-ai-freedomfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to RM AI Freedom in the WordPress admin menu
- Configure your AI provider and API key
- Enable the plugin and save settings
Configuration
OpenAI Setup
- Get your API key from OpenAI Platform
- Select "OpenAI" as your provider
- Enter your API key
- Choose a model (gpt-4o-mini recommended for cost-efficiency)
- Click "Test Connection" to verify
Recommended Models:
gpt-4o-mini- Best value, supports visiongpt-4o- Highest quality, supports visiongpt-4-turbo- Good balance, supports vision
Anthropic Setup
- Get your API key from Anthropic Console
- Select "Anthropic" as your provider
- Enter your API key
- Choose a model (claude-sonnet-4-20250514 recommended)
- Click "Test Connection" to verify
Recommended Models:
claude-sonnet-4-20250514- Best balance of quality and costclaude-opus-4-20250514- Highest qualityclaude-3-7-sonnet-20250219- Extended context
OpenRouter Setup
- Get your API key from OpenRouter
- Select "OpenRouter" as your provider
- Enter your API key
- Choose a model or click "Refresh Models" to see all available
- Click "Test Connection" to verify
Popular Models:
anthropic/claude-3.5-sonnet- Great qualityopenai/gpt-4o-mini- Most cost-effectivegoogle/gemini-pro-1.5- Good alternative
How It Works
RankMath AI Freedom uses a dual-interception strategy to achieve 100% coverage:
1. PHP HTTP Interception
Intercepts server-side HTTP requests that RankMath makes to cai.rankmath.com using WordPress's pre_http_request filter.
2. JavaScript API Interception
Intercepts client-side fetch() calls from RankMath's JavaScript by overriding rankMath.contentAI.url to point to a local REST API proxy.
Architecture
RankMath Content AI (PHP) → pre_http_request filter → Your AI Provider
RankMath Content AI (JS) → URL override + REST proxy → Your AI Provider
Benefits
- ✅ 100% Feature Coverage - All Content AI features work
- ✅ No modifications to RankMath plugin files
- ✅ Works with both free and pro versions
- ✅ Seamless - RankMath doesn't know the difference
- ✅ Interactive features work (Chat, Write, Improve, etc.)
Cost Comparison
RankMath Content AI Pricing
- 500 credits: $49/month
- 2000 credits: $99/month
- 10000 credits: $199/month
With Your Own API Keys (Example)
- OpenAI gpt-4o-mini: ~$0.15 per 1M input tokens, ~$0.60 per 1M output tokens
- Anthropic Claude Sonnet: ~$3 per 1M input tokens, ~$15 per 1M output tokens
- OpenRouter: Varies by model, often cheaper than direct APIs
Typical SEO meta generation: ~500 tokens total = $0.0005 - $0.01 per generation
You can generate thousands of SEO metas for the cost of RankMath's smallest plan!
Troubleshooting
"RankMath SEO required" notice
- Install and activate RankMath SEO plugin first
Network Errors / HTTP 500 / "Connection Failed"
If you see "Network error", HTTP 500, or connection failures:
The plugin has been updated with automatic SSL verification handling to fix the most common cause (missing SSL certificates on servers).
Try again after updating the plugin. If errors persist:
Run Diagnostic Tool:
cd /path/to/wordpress/wp-content/plugins/rankmath-ai-freedom
php diagnostic.php
Common Causes:
- Missing PHP cURL: Install
php-curlextension - Missing OpenSSL: Install
php-opensslextension - Firewall blocking: Whitelist API endpoints:
- api.openai.com:443
- api.anthropic.com:443
- openrouter.ai:443
- Timeout issues: Increase PHP timeout limits
Detailed Guide: See DIAGNOSTICS.md for complete troubleshooting steps.
API connection fails
- Verify your API key is correct
- Check that you have credits/billing set up with your provider
- Ensure your server can make HTTPS requests
- Enable WP_DEBUG and check
wp-content/debug.logfor detailed errors
Features not working
- Make sure "Enable Plugin" is checked in settings
- Verify RankMath Content AI features are enabled in RankMath settings
- Check WordPress error logs for details
Models not loading
- Click "Refresh Models" button
- Verify API key has permission to list models
- For Anthropic, models are pre-populated (API doesn't provide list)
Development
File Structure
rankmath-ai-freedom/
├── rankmath-ai-freedom.php # Plugin bootstrap
├── includes/
│ ├── class-rankmath-ai-freedom.php # Main orchestrator
│ ├── class-api-interceptor.php # PHP HTTP interception
│ ├── class-js-interceptor.php # JavaScript URL override
│ ├── class-rest-proxy.php # REST API proxy for JS calls
│ ├── class-credits-mocker.php # Credits mocking
│ ├── class-settings-page.php # Admin UI
│ ├── class-upsell-suppressor.php # Upsell hiding
│ ├── class-prompts.php # SEO prompts (46+ endpoints)
│ └── providers/
│ ├── interface-provider.php # Provider interface
│ ├── class-base-provider.php # Base class
│ ├── class-openai-provider.php # OpenAI implementation
│ ├── class-anthropic-provider.php # Anthropic implementation
│ └── class-openrouter-provider.php # OpenRouter implementation
└── assets/
├── css/admin-settings.css # Admin styles
└── js/
├── admin-settings.js # Admin scripts
└── url-override.js # Content AI URL interceptor
Adding a New Provider
- Create a new class in
includes/providers/extendingBase_Provider - Implement all methods from
Provider_Interface - Add provider option to settings page
- Update API interceptor to handle the new provider
Privacy & Security
- API keys are stored in WordPress database (wp_options)
- All API calls go directly from your server to your chosen provider
- No data is sent to RankMath's servers when the plugin is enabled
- RankMath never sees your AI provider API key
License
GPL v2 or later
Support
For issues, feature requests, or questions:
- Open an issue on GitHub
- Check existing issues for solutions
Disclaimer
This plugin is not affiliated with, endorsed by, or connected to RankMath or any AI provider. Use at your own risk.
Changelog
1.1.4
- Compatibility with Rank Math 1.0.278 / Pro 3.0.121
- Connect emulator now sets
connected => true(required byis_site_connected()) - Server-side interceptor now catches every
/ai/*endpoint instead of a fixed whitelist - Added handlers/prompts for Link Genius and Keyword Intent endpoints (
keyword_intent,bulk_keyword_intent,keyword_variations,suggest_links,related_posts,suggest_link_opportunities) - Added new endpoint names (
main_points,keyword_intent,bulk_keyword_intent, …) to the supported/usage list - Added
tests/self-check.phpfor the JSON response formatting logic
1.1.0
- 100% Coverage: All RankMath Content AI features now supported
- Added JavaScript API interception for interactive features
- Added REST API proxy for client-side AI calls
- Added AI Chat support with conversation history
- Added 46+ content generation endpoint types
- Added
generate_chat()method to all providers - Improved autoloader for nested namespaces
1.0.0
- Initial release
- Support for OpenAI, Anthropic, and OpenRouter
- PHP-side Content AI features supported
- Unlimited credits mocking
- Upsell suppression