Automate Rank Math SEO Field Updates for WordPress or WooCommerce - n8n Workflow | Neura Market

    Automate Rank Math SEO Field Updates for WordPress or WooCommerce

    This workflow automates the process of updating important Rank Math SEO fields (SEO Title, Description, and Canonical URL) directly via n8n. By leveraging a custom WordPress plugin that extends the WordPress REST API, this workflow ensures that you can programmatically manage SEO metadata for your posts and WooCommerce products efficiently. [Bulk version available here.](https://n8n.io/workflows/4646-rank-math-bulk-title-and-description-optimizer-for-wordpress/) ## How it works: - Sends a POST request to a custom API endpoint exposed by the Rank Math plugin. - Updates SEO Title, Description, and Canonical URL fields for a specified post or product. ### Setup steps: - Install and activate the Rank Math API Manager Extended plugin on WordPress. - Provide the post or product ID you want to update in the workflow. - Run the workflow to update the metadata automatically. ### Benefits: - Full automation of SEO optimizations. - Works for both standard posts and WooCommerce products. - Simplifies large-scale SEO management tasks. To understand exactly how to use it in detail, check out my [comprehensive documentation here.](https://medium.com/@rentierdigital/supercharge-the-rank-math-wordpress-api-how-to-automatically-update-rank-math-seo-fields-with-n8n-6f9127ee0340) ## Rank Math API Manager Extended plugin on WordPress ```language // ATTENTION: Replace the line below with <?php - This is necessary due to display constraints in web interfaces. <?php /** * Plugin Name: Rank Math API Manager Extended v1.4 * Description: Manages the update of Rank Math metadata (SEO Title, SEO Description, Canonical URL) via a dedicated REST API endpoint for WordPress posts and WooCommerce products. * Version: 1.4 * Author: Phil - https://inforeole.fr */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } class Rank_Math_API_Manager_Extended { public function __construct() { add_action('rest_api_init', [$this, 'register_api_routes']); } /** * Registers the REST API route to update Rank Math meta fields. */ public function register_api_routes() { register_rest_route('rank-math-api/v1', '/update-meta', [ 'methods' => 'POST', 'callback' => [$this, 'update_rank_math_meta'], 'permission_callback' => [$this, 'check_route_permission'], 'args' => [ 'post_id' => [ 'required' => true, 'validate_callback' => function($param) { $post = get_post((int)$param); if (!$post) { return false; } $allowed_post_types = class_exists('WooCommerce') ? ['post', 'product'] : ['post']; return in_array($post->post_type, $allowed_post_types, true); }, 'sanitize_callback' => 'absint', ], 'rank_math_title' => [ 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', ], 'rank_math_description' => [ 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', ], 'rank_math_canonical_url' => [ 'type' => 'string', 'sanitize_callback' => 'esc_url_raw', ], ], ] ); } /** * Updates the Rank Math meta fields for a specific post. * * @param WP_REST_Request $request The REST API request instance. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error on failure. */ public function update_rank_math_meta(WP_REST_Request $request) { $post_id = $request->get_param('post_id'); // Secondary, more specific permission check. if (!current_user_can('edit_post', $post_id)) { return new WP_Error( 'rest_forbidden', 'You do not have permission to edit this post.', ['status' => 403] ); } $fields = ['rank_math_title', 'rank_math_description', 'rank_math_canonical_url']; $results = []; $updated = false; foreach ($fields as $field) { if ($request->has_param($field)) { $value = $request->get_param($field); $current_value = get_post_meta($post_id, $field, true); if ($current_value === $value) { $results[$field] = 'unchanged'; } else { $update_status = update_post_meta($post_id, $field, $value); if ($update_status) { $results[$field] = 'updated'; $updated = true; } else { $results[$field] = 'update failed'; } } } } if ($updated) { return new WP_REST_Response($results, 200); } else { return new WP_Error('no_updates', 'No fields were updated.', ['status' => 400]); } } } ```

    Platform
    n8n
    Category
    Marketing
    Price
    Free
    Creator
    phil
    • set
    • httpRequest
    • manualTrigger
    Back to MarketplaceMore n8n Workflows

    How to import this workflow into n8n

    1. 1Purchase or download the workflow to get the n8n workflow JSON file.
    2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
    3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
    4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

    Related Marketing workflows

    • Automate UGC Video Creation and Instagram Posting with Google Gemini and Veo 3Free
    • Automate Lead Generation and Cold Email Outreach
    Free
  1. Automate Professional Video Ad Creation from Product ImagesFree
  2. Track SEO Keyword Rankings with Bright Data MCP and GP-40 AI AnalysisFree
  3. Automate Google Maps Data Scraping and Email Discovery for Local Business OutreachFree
  4. Automate AI-Driven Social Media Content for Auto ServicesFree
  5. More from phil

    • Create Data-Driven SEO Content Briefs with AI Analysis of SERP Data Using Bright Data
    All Marketing workflows →All n8n workflows →

    Need help customizing this workflow?

    Our automation experts adapt it to your exact stack, data, and process — or build one from scratch.

    Get a Custom Build
    Neura Market
    Neura Market
    Marketplace
    Directories
    Resources

    Marketplace

    • Prompts
    • Workflows
    • Agents Store
    • Workflow Packs
    • Categories
    • Marketplace

    Directories

    • AI Tools Directory
    • ChatGPT
    • Claude
    • Gemini
    • Cursor
    • Grok
    • DeepSeek
    • Perplexity
    • CoPilot
    • Midjourney
    • Stable Diffusion
    • MCP Servers
    • .md Directory
    • All Directories

    Free Tools

    • AI Text Humanizer
    • AI Content Detector
    • Workflow Generator
    • Model Comparison
    • AI Pricing Calculator
    • AI Benchmarks
    • ROI Calculator
    • All Free Tools

    Resources

    • AI News
    • Blog
    • AI Models
    • Integrations
    • Alternatives
    • n8n vs Zapier
    • Make vs Zapier
    • n8n vs Make
    • Resource Library
    • Documentation

    Community

    • AI Jobs
    • AI Events
    • AI Companies
    • Start Selling
    • Sell n8n Workflows
    • Sell AI Agents
    • Sell Prompts
    • Creator Guide
    • Advertise
    • Affiliates

    Company

    • About
    • Contact
    • Help
    • Careers
    • Pricing
    • Terms
    • Privacy
    • License
    • DMCA

    Stay Updated

    Get the latest AI tools and insights delivered to your inbox.

    Neura Market Logoneuramarket

    © 2026 Neura Market. All rights reserved.