WP Manifestindependent plugin directory
manifest / seo / rankmath-ai-freedom

RankMath AI Freedom

Use your own AI providers with RankMath Content AI.

★ 0stars

Install

Download source zip No release zip yet

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.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Break 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

Installation

  1. Download or clone this repository
  2. Upload the rankmath-ai-freedom folder to /wp-content/plugins/
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Go to RM AI Freedom in the WordPress admin menu
  5. Configure your AI provider and API key
  6. Enable the plugin and save settings

Configuration

OpenAI Setup

  1. Get your API key from OpenAI Platform
  2. Select "OpenAI" as your provider
  3. Enter your API key
  4. Choose a model (gpt-4o-mini recommended for cost-efficiency)
  5. Click "Test Connection" to verify

Recommended Models:

  • gpt-4o-mini - Best value, supports vision
  • gpt-4o - Highest quality, supports vision
  • gpt-4-turbo - Good balance, supports vision

Anthropic Setup

  1. Get your API key from Anthropic Console
  2. Select "Anthropic" as your provider
  3. Enter your API key
  4. Choose a model (claude-sonnet-4-20250514 recommended)
  5. Click "Test Connection" to verify

Recommended Models:

  • claude-sonnet-4-20250514 - Best balance of quality and cost
  • claude-opus-4-20250514 - Highest quality
  • claude-3-7-sonnet-20250219 - Extended context

OpenRouter Setup

  1. Get your API key from OpenRouter
  2. Select "OpenRouter" as your provider
  3. Enter your API key
  4. Choose a model or click "Refresh Models" to see all available
  5. Click "Test Connection" to verify

Popular Models:

  • anthropic/claude-3.5-sonnet - Great quality
  • openai/gpt-4o-mini - Most cost-effective
  • google/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

  1. ✅ 100% Feature Coverage - All Content AI features work
  2. ✅ No modifications to RankMath plugin files
  3. ✅ Works with both free and pro versions
  4. ✅ Seamless - RankMath doesn't know the difference
  5. ✅ 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:

  1. Missing PHP cURL: Install php-curl extension
  2. Missing OpenSSL: Install php-openssl extension
  3. Firewall blocking: Whitelist API endpoints:
    • api.openai.com:443
    • api.anthropic.com:443
    • openrouter.ai:443
  4. 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.log for 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

  1. Create a new class in includes/providers/ extending Base_Provider
  2. Implement all methods from Provider_Interface
  3. Add provider option to settings page
  4. 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 by is_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.php for 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