Plugin Name: Rank Math API Manager
Version: 1.0.8
Author: Devora AS
Description: WordPress extension that exposes REST API endpoints to update Rank Math SEO metadata programmatically.
This extension enhances the WordPress REST API with custom endpoints that allow external systems (such as n8n workflows) to update Rank Math SEO fields directly via API calls. This eliminates the need for manual SEO configuration and integrates seamlessly with automation.
- SEO Title (
rank_math_title) - Meta title for search engines - SEO Description (
rank_math_description) - Meta description for search engines - Canonical URL (
rank_math_canonical_url) - Canonical URL for duplicate content - Focus Keyword (
rank_math_focus_keyword) - Primary keyword for the article
Updates Rank Math SEO metadata for a specific post or product.
Parameters:
post_id(required) - ID of the post/productrank_math_title(optional) - SEO titlerank_math_description(optional) - SEO descriptionrank_math_canonical_url(optional) - Canonical URLrank_math_focus_keyword(optional) - Focus keyword
Request Example:
curl -X POST "https://example.com/wp-json/rank-math-api/v1/update-meta" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic [base64-encoded-credentials]" \
-d "post_id=123&rank_math_title=Optimized title&rank_math_description=SEO description&rank_math_focus_keyword=keyword"Response:
{
"rank_math_title": "updated",
"rank_math_description": "updated",
"rank_math_focus_keyword": "updated"
}- Upload
rank-math-api-manager.phpto/wp-content/plugins/rank-math-api-manager/ - Activate the plugin in WordPress admin panel
- Verify that the plugin is active
The plugin requires users to have edit_posts permissions to update metadata.
Ensure that the WordPress REST API is available and not blocked by security layers.
This plugin is specifically designed to work with Devora's n8n workflow "Write wordpress post with AI".
- Automatic SEO Generation: AI generates SEO metadata based on content
- Programmatic Update: n8n sends API calls to the plugin
- Seamless Integration: No manual intervention required
{
"method": "POST",
"url": "https://example.com/wp-json/rank-math-api/v1/update-meta",
"contentType": "form-urlencoded",
"bodyParameters": {
"post_id": "={{ $('Post on Wordpress').first().json.id }}",
"rank_math_title": "={{ $('Generate metatitle e metadescription').first().json.output.metatitle }}",
"rank_math_description": "={{ $('Generate metatitle e metadescription').first().json.output.metadescription }}",
"rank_math_focus_keyword": "={{ $('Generate metatitle e metadescription').first().json.output.metakeywords }}"
}
}- Requires WordPress Application Password or Basic Auth
- Validates user permissions (
edit_posts) - Sanitizes all input parameters
- Validates that
post_idexists - Sanitizes text fields with
sanitize_text_field() - Validates URLs with
esc_url_raw()
The plugin automatically supports:
- Posts (standard WordPress posts)
- Products (WooCommerce products, if WooCommerce is active)
All SEO fields are registered as post meta with:
show_in_rest: true- Available via REST APIsingle: true- Single valuestype: string- String data typeauth_callback- Permission control
- Facebook Title (
rank_math_facebook_title) - Facebook Description (
rank_math_facebook_description) - Facebook Image (
rank_math_facebook_image) - Twitter Title (
rank_math_twitter_title) - Twitter Description (
rank_math_twitter_description) - Twitter Image (
rank_math_twitter_image)
- Robots Meta (
rank_math_robots) - Advanced Robots (
rank_math_advanced_robots) - Primary Category (
rank_math_primary_category) - Secondary Focus Keyword (
rank_math_secondary_focus_keyword) - Tertiary Focus Keyword (
rank_math_tertiary_focus_keyword)
- Schema Type (
rank_math_schema_type) - Article Schema Type (
rank_math_schema_article_type)
POST /wp-json/rank-math-api/v1/bulk-update- Update multiple posts/products in one API request
- Support for batch processing
- Error handling for individual updates
GET /wp-json/rank-math-api/v1/get-meta/{post_id}
GET /wp-json/rank-math-api/v1/posts- Retrieve existing SEO metadata
- List of posts with SEO information
- Filtering and sorting
GET /wp-json/rank-math-api/v1/seo-status/{post_id}- SEO score for posts
- Missing fields
- Improvement recommendations
- Schema status
POST /wp-json/rank-math-api/v1/smart-update- Update only if fields are empty
- Update only if values are different
- Minimum/maximum length validation
- Duplicate checking
POST /wp-json/rank-math-api/v1/webhooks- Register webhooks for SEO updates
- Real-time notifications for changes
- Configurable webhook endpoints
POST /wp-json/rank-math-api/v1/apply-template- Predefined SEO templates
- Variable substitution
- Content-based templates (blog, product, page)
POST /wp-json/rank-math-api/v1/validate- Validation of SEO metadata before saving
- Length controls
- Keyword density
- Duplicate checking
GET /wp-json/rank-math-api/v1/analytics- SEO statistics for the website
- Average SEO score
- Schema implementation rate
- Missing metadata overview
- Rate limiting per user/IP
- API key support
- Audit logging
- Advanced error handling
POST /wp-json/rank-math-api/v1/multisite-update- Support for WordPress multisite
- Cross-site SEO synchronization
- Centralized SEO administration
- Google Search Console API integration
- Google Analytics 4 integration
- External SEO tool integration
| Phase | Features | Estimated Delivery | Status |
|---|---|---|---|
| 1 | Extended Field Support | Q3 2025 | π Planned |
| 2 | Bulk Operations | Q3 2025 | π Planned |
| 3 | Automation | Q3 2025 | π Planned |
| 4 | Advanced Features | Q4 2025 | π Planned |
| 5 | Enterprise | Q1 2026 | π Planned |
- Update SEO metadata when content is syndicated
- Cross-site SEO synchronization
- Automatic SEO optimization
- Integration with AI tools
- Automatic keyword generation
- Content-based SEO suggestions
- Product catalog optimization
- Seasonal campaigns
- Inventory-based SEO updates
- Mass reporting of posts
- SEO audit automation
- Competitor analysis integration
Q: What is Rank Math API Manager? A: Rank Math API Manager is a WordPress plugin that allows you to update Rank Math SEO metadata programmatically via REST API endpoints. It's specifically designed to integrate with automation like n8n workflows.
Q: Which WordPress versions are supported? A: The plugin requires WordPress 5.0 or newer and PHP 7.4 or newer.
Q: Is Rank Math SEO plugin required? A: Yes, the Rank Math SEO plugin must be installed and activated for this plugin to work.
Q: How do I install the plugin?
A: Upload the plugin file to /wp-content/plugins/rank-math-api-manager/ and activate it in the WordPress admin panel.
Q: What permissions do I need?
A: You must have edit_posts permissions to use the API endpoints.
Q: How do I set up authentication? A: Use WordPress Application Passwords or Basic Auth. See the installation section for details.
Q: Which SEO fields can I update? A: The plugin supports SEO Title, SEO Description, Canonical URL, and Focus Keyword.
Q: Can I use this with WooCommerce? A: Yes, the plugin automatically supports WooCommerce products if WooCommerce is active.
Q: How do I integrate with n8n? A: See the n8n integration section in the documentation for example configuration.
Q: Is there rate limiting on the API endpoints? A: The plugin uses WordPress's built-in rate limiting. For high-traffic sites, additional rate limiting is recommended.
Q: Are the API endpoints secure? A: Yes, all endpoints require authentication and validate user permissions. All input parameters are sanitized.
Q: How do I report security issues? A: Send security reports to security@devora.no. Do not create public GitHub issues for security problems.
Q: Is sensitive data logged? A: No, the plugin does not log sensitive data.
Q: How do I update the plugin? A: The plugin can be updated via the WordPress admin panel or by manually uploading a new version.
Q: Are there automatic updates? A: Yes! The plugin includes a complete WordPress-native auto-update system that checks for new releases on GitHub and provides update notifications just like WordPress.org plugins. Users can enable/disable automatic updates and view release details.
Q: How do I check if the plugin is working?
A: Test the API endpoint with a simple POST request to /wp-json/rank-math-api/v1/update-meta.
Q: I get 401 Unauthorized errors?
A: Check that the Application Password is correctly configured and that the user has edit_posts permissions.
Q: I get 404 Not Found errors? A: Verify that the plugin is active and that the WordPress REST API is available.
Q: I get 400 Bad Request errors?
A: Check that the post_id exists and that all parameters are correctly formatted.
Q: WooCommerce integration doesn't work? A: Check that WooCommerce is installed and activated.
Q: Will there be support for more SEO fields? A: Yes, see the roadmap section for planned features like social media meta tags and schema markup.
Q: Will there be bulk operations? A: Yes, bulk updates are planned for phase 2 of development.
Q: Will there be webhook support? A: Yes, webhook support is planned for phase 3.
-
401 Unauthorized
- Check that Application Password is correctly configured
- Verify that the user has
edit_postspermissions
-
404 Not Found
- Check that the plugin is active
- Verify that the REST API is available
-
400 Bad Request
- Check that
post_idexists - Validate that all parameters are correctly formatted
- Check that
Enable WordPress debug logging to see detailed error messages:
// wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);To contribute to this plugin:
- Follow WordPress coding standards
- Test changes thoroughly
- Update documentation
- Use descriptive commit messages
- Follow our Code of Conduct
Developed by: Devora AS
Website: https://devora.no
If you discover a bug or have other problems with the plugin, you can:
- Create a GitHub Issue: Visit GitHub Issues and create a new issue
- Include the following information:
- WordPress version
- Plugin version
- PHP version
- Description of the problem
- Steps to reproduce the problem
- Error messages (if any)
- Screenshots (if relevant)
Important: Do not report security issues via GitHub Issues. Send them to security@devora.no instead.
- General support: Contact Devora team via devora.no
- Security issues: security@devora.no
- Code of Conduct: conduct@devora.no
- Changelog: See changelog for all versions
- Security Policy: Security policy and vulnerability reporting
- Code of Conduct: Community guidelines for contributors
- Norwegian Documentation: Norwegian version of this documentation
- Norwegian Changelog: Norwegian changelog
- Norwegian Security Policy: Norwegian security policy
- Norwegian Code of Conduct: Norwegian code of conduct
License: GPL v3 - Devora AS
Last Updated: July 2025
