Rank Math Bulk Title & Description Optimizer for WordPress - n8n Workflow

Automate SEO optimization for WordPress using this n8n workflow. Bulk rewrite Rank Math titles and meta descriptions using OpenRouter and LangChain AI integration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

SEO Specialists managing large WordPress sites.
Content Managers needing to quickly audit and improve existing post SEO metadata.
Developers looking for advanced n8n templates integrating WordPress and specialized AI models (like OpenRouter).
Users familiar with the WordPress REST API and n8n node configuration.

Overview

Maintaining optimal SEO across hundreds of articles can be tedious. This powerful n8n workflow solves the problem of manually optimizing Rank Math titles and meta descriptions in WordPress. It leverages the flexibility of the n8n platform to fetch post data, run conditional checks, and utilize cutting-edge AI via the OpenRouter service (integrated through LangChain) to generate high-quality, structured SEO meta content. The entire process is automated, from initiating the n8n trigger to updating the WordPress database directly using an HTTP Request n8n node targeting the specific Rank Math metadata fields. This n8n workflow is crucial for large-scale content optimization projects.

How it Works

The execution starts with a manual n8n trigger, initializing the settings n8n node where the base WordPress URL is defined.


  1. Initialize & Fetch IDs: The n8n workflow uses an HTTP Request n8n node ("Get Posts ID") to pull a list of all relevant post IDs from the WordPress site. A subsequent Limit n8n node can be used for safe testing (e.g., limiting to 5 posts), though this should be removed for production.

  2. Batch Processing: The n8n node Split in Batches ("Post") iterates through each fetched post ID sequentially.

  3. Retrieve Content: For each ID, the WordPress n8n node ("Get post") retrieves the full content, which is essential context for the AI model.

  4. Conditional Check: The If n8n node ("Should I Rewrite") checks if the current post already has optimized metadata. If the conditions for rewriting are met (e.g., meta fields are empty), the n8n workflow proceeds down the true path.

  5. AI Generation: The LangChain n8n node ("Create Meta Infos") uses a structured prompt that incorporates the post content. This chain is powered by the OpenRouter Chat Model n8n node and uses the Structured Output Parser n8n node to ensure the new title and description are returned in a clean, predictable JSON format.

  6. Update WordPress: Finally, the generated, optimized metadata is sent back to the WordPress site via a final HTTP Request n8n node ("Update Post Metas"), ensuring the Rank Math fields are updated automatically. The flow then loops back via the "Post" node to process the next item until all posts are complete. This robust n8n workflow design ensures reliable bulk processing using the n8n platform.

Installation Guide

To use this advanced n8n workflow template:


  1. Import: Copy the provided JSON code and import it directly into your n8n canvas using the 'New' -> 'Import from JSON' option.

  2. Credentials Setup:

WordPress: You will need WordPress API credentials (Username/Application Password) set up for the "Get post" n8n node.
HTTP Requests: The HTTP Request n8n nodes ("Get Posts ID" and "Update Post Metas") will require basic authentication headers configured to interact with your site's REST API (essential for accessing the Rank Math endpoints).
OpenRouter: Configure your OpenRouter API key credential for the "OpenRouter Chat Model" n8n node.

  1. Configuration:

Settings Node: Edit the "settings" n8n node to define your baseURL parameter, ensuring the trailing slash is included (e.g., https://yourdomain.com/).
* Limit Node: Remove or disable the "Limit" n8n node before running the n8n workflow in production to ensure all posts are processed.

  1. Execution: Click the "Execute workflow" button on the starting n8n trigger to begin the optimization run.

Node Details

This n8n template relies on specialized and core n8n node types:

When clicking ‘Execute workflow’ (Manual Trigger n8n trigger):
Function: Starts the n8n workflow manually.
Key Configuration: Standard manual execution n8n trigger setup.
settings (Set n8n node):
Function: Stores global variables, critically the baseURL for the WordPress site, used by subsequent HTTP Request nodes.
Key Configuration: Defines the base URL variable for dynamic use.
Get Posts ID & Update Post Metas (HTTP Request n8n node):
Function: Handles direct, authenticated interaction with the WordPress REST API endpoints, fetching ID lists and submitting the AI-generated metadata updates to the Rank Math schema.
Key Configuration: Method (GET/POST), URL defined dynamically using the baseURL variable, and required Authentication configuration.
Get post (WordPress n8n node):
Function: Retrieves detailed content for a single post item passed down the n8n workflow, providing context for the AI.
Key Configuration: Resource set to 'Post', Operation set to 'Get'.
Should I Rewrite (If n8n node):
Function: Implements core logic flow control by determining if the current post requires AI optimization.
Key Configuration: Condition logic targets metadata fields to check for emptiness or specific flags.
Create Meta Infos (LangChain LLM Chain n8n node):
Function: The central AI engine. It orchestrates the prompt engineering and uses connected language model components to perform the title and description rewrite within the n8n workflow.
Key Configuration: Connects to the LLM and Parser nodes.
OpenRouter Chat Model (LangChain OpenRouter n8n node):
Function: Provides the specific large language model accessed via the OpenRouter API for generation tasks within this n8n workflow.
Key Configuration: Requires OpenRouter API credential setup.
Structured Output Parser (LangChain Output Parser n8n node):
* Function: Ensures the output from the AI model is strictly formatted (e.g., JSON), making it reliable for subsequent data processing and integration into the update HTTP Request n8n node.

Related n8n Workflows

Paid

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Accélérateur de Chiffre d'Affaires : Automatisez votre entreprise pour la rendre plus visible sur Google, pour trouver de nouveaux Clients, pour gagner du temps

Featured*