page-banner-shape-1
page-banner-shape-2
  • stonecastel243@gmail.com
  • May 22, 2025
  • 0
AI-generated WordPress content automation

how to Generate SEO-Optimized WordPress Content with AI

Publishing high-quality, SEO-optimized articles on your WordPress blog can be a time-consuming task — but with n8n, OpenAI, and Perplexity AI, you can fully automate this process. In this tutorial, you’ll learn how to build an AI-powered content generation workflow using n8n and connect it directly to your WordPress site. 🧠⚡

🧩 Step 1: Download the n8n Workflow Template

To make things easy, we’ve prepared a complete automation workflow in JSON format.

👉 Download the workflow here:

Once downloaded:

  • Open your n8n instance.
  • Create a new workflow.
  • Click the top-right menu (three dots) > Import from File.
  • Upload the downloaded .json file.

🌐 Step 2: Configure the Perplexity Research Node

🧪 What is this for?

This node uses Perplexity AI to perform research on a topic.

🔧 Setup Instructions:

  1. Visit https://www.perplexity.ai/account/api/keys
  2. Create an account (if you don’t have one).
  3. Copy your API Key.
  4. In n8n, open the HTTP Request node labeled Perplexity Research.
  5. Paste your API key in the headers field like this:
    • Authorization: Bearer YOUR_API_KEY

🤖 Step 3: Configure the OpenAI API Key

🧠 What is this for?

This node will use ChatGPT to generate the actual article content, titles, and HTML.

🛠️ Setup Instructions:

  1. Go to https://platform.openai.com/api-keys
  2. Log in and generate a new API Key.
  3. In n8n, navigate to your credentials section.
  4. Create a new OpenAI API Key credential and paste your key.
  5. Link this credential to all OpenAI nodes in the workflow.

✍️ Step 4: Customize AI Prompts for Content Generation

In this step, you’ll edit the prompts to control how the article is written.

🧠 Node: Copywriter AI Agent

This is where the main article content is generated.

Prompt:

You are part of a Canadian marketing team that creates high-quality blog posts for the AI ​​consulting and workflow automation industry. Your goal is to produce engaging, SEO-optimized content that positions the company as a leader in the AI ​​consulting industry and attracts leads.

Every two days, your team publishes a blog post on the most trending topics in AI consulting and n8n workflows. As a writer, you have the following information:

- Query: The main topic of the week's blog post, representing the most trending news in the recruitment field.

- Other keywords: A list of high-volume keywords related to AI consulting and n8n workflows. Integrate them naturally into the blog post, where appropriate, without forcing them or changing the meaning.

- Research findings: Detailed information from reliable sources related to the blog topic. Your article should be based on this research.

Based on this information, write a comprehensive blog post:

- Include the query in the title, H2 heading, and at the beginning of the introduction;
- Include all details from the search results, including source URLs for possible hyperlinks;
- Be detailed and informative, highlighting the company's expertise in AI consulting and n8n workflows for business process automation;
- Adopt a professional and engaging tone, highlighting exciting developments and challenges in the recruitment industry;
- Be natural and logical, making it easy to understand;
- Be between 500 and 1,000 words;
- Be written at a level accessible to HR professionals and business leaders.

Additional Requirements:
- Include practical points or tips for recruiters and HR professionals;
- Highlight the connection between the topic and the company's services or expertise;
- Include a call to action (CTA) encouraging readers to explore the company's services or contact them for more information.

Create the entire draft of the blog post in your first post. Do not interrupt or cut it.

Your post must be the blog post and nothing else.

Here are the details of this draft blog post:

Query:
{{ $('On form submission').item.json['Research Query'] }}

Detailed Search:
{{ $('Cleanup Links').item.json.research }}

💻 Node: Create HTML

This formats your article as HTML for WordPress publishing.

Prompt:

Display only the HTML content without any preamble or additional explanation. Generate WordPress-compatible HTML code for a blog post based on the provided content.

### CONTENT PROCESSING:
- Process all content from {{ $json.output }}
- Preserve all facts, information, and original URLs
- Format according to the specifications below

### REQUIRED STRUCTURE (IN THIS ORDER):
1. Heading (H2)
2. Estimated Reading Time
3. Key Points (3-5 bullet points)
4. Table of Contents (linked to all headings)
5. Main Content (with appropriate heading hierarchy)
6. FAQ

### STYLE REQUIREMENTS:
- Style Override: Include a style section with !important statements

- Spacing: Add <br><br> between each main section

### COMMITMENT FORMATTING:
- Use bold, italics, bullets, quotation marks, and underlining to emphasize text
- Structure paragraphs properly with Proper line breaks
- No emojis
- Use spaces strategically for better readability

### HYPERTEXT LINK MANAGEMENT (ESSENTIAL):
- When URLs appear next to keyword phrases (e.g., "AI Tools (https://example.com)")
- Convert to: <a href="https://example.com" style="color: #00c2ff !important;">AI Tools</a>
- The keyword phrase should be linked, never the URL itself

### WORDPRESS COMPATIBILITY:
- Use WordPress block classes (wp-block-heading, wp-block-paragraph, etc.)
- Add heading IDs beginning with "h-" for better linking to the table of contents
- Ensure all styles use !important to override theme styles

Do NOT include explanations, code tags, or comments. Show ONLY raw HTML code.

🧠 Node: Create Title & Slug

Generates an SEO-optimized title and slug for your WordPress post.

Prompt:

**Create a slug, article title, and meta description for the following article:**

{{ $json.output }}

**Slug Guidelines:**
- Be concise (4-5 words maximum).
- Include the main keyword related to recruitment or HR.
- Use hyphens to separate words.
- Avoid unnecessary words, articles, or prepositions.
- Ensure the text reflects the main topic of the article.
- Ensure it is readable and relevant to users and search engines.

**Title Guidelines:**
- Avoid AI-related terms like "Transform" or "Revolutionize" and similar overused terms.
- Avoid using a colon (:) in the title.
- Never structure it as a main/secondary title separated by a colon. - Include the main keyword related to recruiting or HR (e.g., "AI in recruiting" or "talent acquisition trends").
- Clearly explain to users what they can expect from reading the article.
- Be concise and engaging, ideally 50-60 characters.
- Include powerful keywords that appeal to HR professionals and recruiters.

**Meta Description Guidelines**:
- Avoid overused artificial intelligence terms like "Transform" or "Revolutionize" and similar terms.
- Be concise: Limit your length to 150-160 characters to ensure optimal visibility in search results.
- Include keywords: Naturally integrate recruiting-related keywords to improve relevance and visibility. - Provide value: Clearly present the benefits or insights readers will gain from the article.
- Be engaging: Use action-oriented language or a thought-provoking question to encourage clicks.
- Align with the content: Accurately reflect the content of the blog post to meet user expectations and reduce bounce rates.
- Highlight your expertise: Subtly highlight SocialFind's authority in the recruiting field.

Your output must be a single, valid JSON object with these three fields:
-slug: the slug
-title: the title of the article
-meta: the meta description

Each element must be presented without additional text, explanation, quotation marks, or formatting.

🖼️ Step 5: Fetch a Cover Image using SerpAPI

We’ll use SerpAPI to automatically search and download a cover image related to your article.

🔧 Setup:

  1. Go to https://serpapi.com/ and create an account.
  2. Copy your API Key.
  3. In the HTTP Request node labeled SERP Image, update:
    • Endpoint URL to:
    • https://serpapi.com/search.json?q={{$json["title"]}}
    • api_key=YOUR_API_KEY
    • Add your API key to the query params.

📝 Step 6: Connect and Configure the WordPress Node

🔐 Create an Application Password:

  1. Log into your WordPress admin.
  2. Go to Users > Profile > Application Passwords.
  3. Generate a new application password and copy it.

🔧 Setup in n8n:

  1. Open the WordPress node in your workflow.
  2. Paste your WordPress URL, username, and application password.
  3. Map the fields:
    • title: From the Title & Slug node.
    • slug: From the same node.
    • content: From the Create HTML node.
    • featured_media: (Optional) Use the URL from SERP Image.

✅ Final Step: Test & Publish

Once all your nodes are configured:

  • Press Execute Workflow in n8n.
  • Wait for all steps to complete.
  • The article will be automatically published on your WordPress site — with a title, featured image, and SEO-optimized content. 🎉

💡 Final Tips

  • You can modify prompts to generate different writing tones (informative, humorous, professional, etc.).
  • Use n8n’s schedule trigger to automate article publishing weekly or daily.
  • Use custom categories or tags in the WordPress node to improve SEO structure.

🔚 Conclusion

With just a few API keys and the power of AI, you can build a hands-free content machine that keeps your WordPress blog fresh and SEO-optimized every day. Try it out and let your creativity meet automation!

Leave a Reply

Your email address will not be published. Required fields are marked *