Get AI summaries of any video or article — Sign up free
Automate SEO-Optimized Blog with n8n + Perplexity + SerpAPI (Full Build & Demo) thumbnail

Automate SEO-Optimized Blog with n8n + Perplexity + SerpAPI (Full Build & Demo)

Alex, PhD AI·
5 min read

Based on Alex, PhD AI's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Use n8n to schedule weekly runs, but keep a manual execution path for testing before going live.

Briefing

A full automation pipeline can generate an SEO-optimized WordPress blog draft end to end: it pulls a weekly trending topic, uses Perplexity for deep research, writes an article with targeted keywords, creates or retrieves an image, formats everything into WordPress-ready HTML, and uploads the draft with structured metadata fields. The practical payoff is speed—turning a spreadsheet of company details into a publishable draft on a schedule—while still acknowledging where WordPress automation hits API limits.

The workflow starts in n8n with two execution paths: a scheduled run (set to trigger every week on Wednesday at 2:00 a.m. GMT in the example) and a manual run for testing. In both cases, the pipeline reads company and audience inputs from a Google Sheets spreadsheet—fields like “Who we are,” “What are you selling,” differentiators, customer age and job titles, niche, and desired word count. Those inputs guide the topic selection and the downstream writing so the content matches an ICP rather than generic trends.

Topic discovery uses Google News via SERPAPI (configured as a “search Google news” operation). The returned popular titles feed an OpenAI step that generates a similar blog title tailored to the company’s niche. Next, Perplexity (configured with the “sonar deep search” model) performs a deeper web research pass on that title and returns structured findings and citations. Those results are then transformed into SEO assets: a metadata generation step produces the article’s focus keyword, SEO title, slug, meta description, and social sharing fields (Open Graph and Twitter), while an “information extractor” structures keyword placement guidance—what keywords to use, how often, and where to place them.

The article-writing agent then produces the full blog content using the title and SEO keyword plan, with a strict output structure that feeds directly into formatting. An image agent either generates an image via OpenAI (DALL·E 3 by default, with an option to use a different image model) or retrieves a stock image from Pexels using a Pexels API key. Another agent generates image alt text and image keyword metadata, and a WordPress formatting step converts the combined text and image instructions into HTML suitable for WordPress.

After execution, the pipeline writes results back to the spreadsheet (including the generated/retrieved image URL and all SEO fields) and creates a WordPress draft via the WordPress API. However, the workflow deliberately stops short of fully automating SEO scoring and schema setup. During the demo, Rank Math and Content AI scores were not fully populated automatically—because WordPress API endpoints for those SEO settings and schema aren’t available—so the user must manually paste focus keyword and social snippet fields, then verify Rank Math/Content AI scores before publishing.

Overall, the system is a workable blueprint for scaling content production: it automates research, writing, keyword planning, image selection, and draft creation, while leaving a small but important manual checklist for SEO plugins and schema fields inside WordPress.

Cornell Notes

The n8n workflow turns a Google Sheets “company profile” into a scheduled WordPress blog draft. It finds a trending topic using SERPAPI (Google News), generates a tailored title, then uses Perplexity (sonar deep search) for research and citations. OpenAI agents convert that research into an SEO keyword plan and write a full article, then either generate an image (DALL·E 3) or fetch one from Pexels, including alt text. The pipeline formats the result as WordPress-ready HTML and uploads a draft, while manual steps remain for Rank Math fields and schema because WordPress API support is limited. The result is faster publishing with a repeatable spreadsheet-driven process.

How does the workflow decide what to write about each week?

It schedules execution in n8n (example: every Wednesday at 2:00 a.m. GMT) and, on each run, reads company and audience inputs from Google Sheets. It then queries Google News through SERPAPI and selects a popular title returned by that search. That title becomes the basis for an OpenAI step that generates a similar, niche-aligned blog title.

What role does Perplexity play compared with SERPAPI?

SERPAPI is used for discovery—pulling popular Google News titles. Perplexity then performs the deeper research pass on the chosen title using the “sonar deep search” model, returning structured findings and citations. Those research outputs feed the later SEO metadata generation and article-writing steps.

How does the system turn research into SEO metadata and keyword placement?

After Perplexity returns structured research, an OpenAI metadata generation step produces SEO fields such as focus keyword (used as the H1), SEO title, slug, meta description, and social metadata (Open Graph and Twitter). An “information extractor” then structures a keyword plan—what keywords to use, how many times they should appear, and where they should be placed—so the article-writing agent can follow the plan.

How are images handled, and what metadata is produced for them?

The pipeline can either generate an image with OpenAI (DALL·E 3 is the default in the demo) or retrieve a stock image from Pexels using a Pexels API key. A separate image-alt-text agent generates alt text and structured image keyword information. The workflow merges the chosen image (generated or retrieved) with the SEO text and prepares the combined output for WordPress.

Why does publishing still require manual SEO work inside WordPress?

WordPress API limitations prevent full automation of Rank Math SEO settings and schema. In the demo, the draft was created with content and image, but SEO plugin fields like focus keyword, snippet data, and schema-related configuration had to be entered manually. The user then checks Rank Math and Content AI scores before publishing.

What does the Google Sheets spreadsheet contain, and why is it central to the automation?

The spreadsheet stores both inputs and outputs. Inputs include “Who we are,” “What are you selling,” differentiators, customer demographics, niche, and desired word count. Outputs are filled by the workflow: generated topic/title, focus keyword, SEO title, slug/URL, meta description, Open Graph and Twitter titles/descriptions, and image URLs (generated or extracted). This spreadsheet acts as the control panel and the audit trail for each run.

Review Questions

  1. Which external service is responsible for pulling popular Google News titles, and which one performs deep research with citations?
  2. What specific SEO fields are generated and written back to the spreadsheet before the WordPress draft is created?
  3. What parts of Rank Math SEO setup remain manual after the draft upload, and why?

Key Points

  1. 1

    Use n8n to schedule weekly runs, but keep a manual execution path for testing before going live.

  2. 2

    Drive topic selection and writing quality with Google Sheets inputs like niche, differentiators, customer profile, and desired word count.

  3. 3

    Use SERPAPI for Google News discovery, then Perplexity (sonar deep search) for research and citations that inform the article.

  4. 4

    Generate a structured SEO plan (focus keyword, meta fields, social snippets, and keyword placement guidance) before writing the article text.

  5. 5

    Choose image generation (OpenAI/DALL·E 3) or image retrieval (Pexels API) and always generate alt text for SEO and accessibility.

  6. 6

    Upload WordPress drafts via the WordPress API, but expect to manually complete Rank Math focus keyword/snippets and schema because API coverage is limited.

  7. 7

    Treat the spreadsheet as both the configuration source and the output ledger so each run’s SEO fields and image URLs are traceable.

Highlights

The pipeline is spreadsheet-driven: company and audience details in Google Sheets steer trending-topic selection, title generation, and keyword planning.
Perplexity’s “sonar deep search” output feeds directly into SEO metadata generation and the final article-writing step, including citations-based research.
Image handling is flexible—generate with OpenAI or retrieve from Pexels—while an alt-text agent produces SEO-relevant image descriptions.
WordPress drafts can be uploaded automatically, but Rank Math SEO scoring and schema fields still require manual completion due to WordPress API limits.

Topics

  • n8n Workflow
  • SEO Automation
  • Perplexity Research
  • SERPAPI Google News
  • WordPress Drafts

Mentioned

  • Alex, PhD AI
  • ICP
  • SEO
  • AI
  • HTML
  • API
  • GMT