Automate WordPress Blog Posting with n8n and Airtable

Struggling to manually post AI-generated blog content from Airtable to WordPress, including setting featured images? This n8n automation simplifies the entire process by fetching, formatting, posting, and updating blog posts efficiently, saving hours of manual work.
wordpress
airtable
httpRequest
+5
Workflow Identifier: 2059
NODES in Use: scheduleTrigger, airtable, filter, set, markdown, wordpress, httpRequest, stickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

Opening Problem Statement

Meet Sarah, a content manager at a growing digital marketing agency. She spends hours each week manually transferring AI-generated blog posts stored in Airtable into her company’s WordPress website. Not only does she have to copy and paste markdown content and convert it to HTML, but she also painstakingly uploads and sets the featured images for each post. This repetitive, error-prone process wastes her valuable time and often leads to formatting inconsistencies and delayed publishing schedules.

Sarah loses approximately 5-7 hours weekly in managing this workflow, leading to frustration and missed opportunities to boost online presence on schedule. Manual mistakes in image uploads and post formatting mean extra rounds of edits, costing even more time and money.

This is where automation with n8n comes in. By integrating Airtable with WordPress via n8n, Sarah can automatically fetch the AI-generated blog posts marked as “To Post”, convert the content from markdown to HTML, upload the post and its featured image, and finally update Airtable status—all without lifting a finger.

What This Automation Does

This n8n workflow automates the publishing of AI-generated blog content from Airtable to a WordPress website, complete with featured images. Specifically, it:

  1. Fetches blog posts marked “To Post” from Airtable.
  2. Filters out incomplete posts to ensure only valid content proceeds.
  3. Transforms markdown blog content into HTML format ready for WordPress.
  4. Publishes the blog post as a draft on WordPress with title and content.
  5. Searches and downloads a relevant featured image using the Pexels API based on the blog’s keyword.
  6. Uploads the image to WordPress media and sets it as the post’s featured image.
  7. Updates Airtable to mark the post status as “Posted” after successful publishing.

This automation saves Sarah upwards of 5 hours per week, eliminates manual errors, and keeps her blog posting process consistent and timely.

Prerequisites ⚙️

  • n8n account to create and run workflows.
  • Airtable account with a base that includes a table for AI-generated blog posts with columns: Keyword, Title, Blog content (in markdown), and a Status column to track publishing stages.
  • WordPress website with REST API access and credentials for API authentication to post blogs and upload media.
  • Pexels API key for fetching relevant blog images.

Optional: Self-host n8n for full control and scalability (see Hostinger n8n hosting).

Step-by-Step Guide to Automate WordPress Blog Posting

Step 1: Set up the Schedule Trigger to Run Periodically ⏱️

In n8n, add the Schedule Trigger node.

  • Navigate to the node panel → Search and select Schedule Trigger.
  • Configure the interval (default runs every minute, adjust for your needs).
  • This node starts the workflow automatically at your set intervals.
  • Expected outcome: Workflow runs regularly without manual start.

    Common mistake: Forgetting to enable the workflow after setup.

    Step 2: Fetch Blog Posts from Airtable Marked “To Post” 📊

    Add the Airtable node with operation set to “Search”.

    • Select your Airtable base and table where blogs are stored.
    • Use the filter formula: SEARCH("To Post", {Status}) to get only posts needing publishing.
    • Expected outcome: Gets up to 3 blog posts ready to publish.

      Common mistake: Incorrect base/table selection causing empty results.

      Step 3: Filter Out Empty Blog Content

      Use the Filter node to check that the “Blog Post” field exists and is not empty.

      Condition example:

      {
        "leftValue": "={{ $json['Blog Post'] }}",
        "operator": "exists"
      }

      > Only posts with content proceed.

      Step 4: Prepare Data Fields with the Set Node

      Add the Set node to rename and organize fields.

      • Assign values like id, Title, Keyword, and remove title from the raw markdown blog post to create a clean Blog Body.
      • Use this JavaScript expression: = {{$json["Blog Post"].replace($json["Title"],'')}}.
      • Expected outcome: Clean, structured data passing to next steps.

        Step 5: Convert Markdown Blog Content to HTML

        Use the Markdown node to convert Blog Body from markdown to HTML content.

        Set mode to “markdownToHtml” and destination key to “Blog Body” for later use.

        Expected outcome: The blog content is ready for WordPress format.

        Step 6: Publish the Blog Post as Draft on WordPress

        Add the WordPress node to create a new post.

        • Map the blog title and HTML content using expressions = {{$json.Title}} and = {{$json['Blog Body']}}.
        • Set the post status as draft to review before going live.
        • Expected outcome: A blog post draft created in WordPress.

          Step 7: Fetch a Relevant Image Using Pexels API

          Add the HTTP Request node to call the Pexels API.

          • Use GET method with URL format: https://api.pexels.com/v1/search?query=Keyword&per_page=1&width=1200&height=675&format=webp.
          • Authorize using your Pexels API key in headers.
          • Expected outcome: Returns top image data matching the blog keyword.

            Step 8: Download the Selected Image

            Use another HTTP Request node configured to GET the image URL from the previous node’s response with response format set to “file”.

            Expected outcome: Image file is downloaded ready for upload.

            Step 9: Upload the Image to WordPress Media Library

            Add the HTTP Request node to POST the binary image data to WordPress media endpoint /wp-json/wp/v2/media.

            • Set headers for content-disposition and content-type dynamically.
            • Use credentials for WordPress API authentication.
            • Expected outcome: Image file uploads successfully into WordPress.

              Step 10: Set the Uploaded Image as Featured Image for the Post

              Add another HTTP Request node to update the post with the featured_media ID returned from the image upload.

              Expected outcome: Post now shows the downloaded image as the featured image.

              Step 11: Update the Airtable Record Status to “Posted”

              Add another Airtable node to update the blog’s status back in Airtable.

              Map the record ID with status set to “Posted” so it doesn’t get reposted.

              Expected outcome: Airtable accurately reflects published posts.

              Customizations ✏️

              1. Change Post Status from Draft to Publish
                In the WordPress node, change status from draft to publish for immediate live posts.
              2. Add Multiple Images per Post
                Modify the workflow to loop fetching and uploading multiple images using Pexels API query variations and update featured_image accordingly.
              3. Use Different Image Sources
                Replace the Pexels API HTTP Request node with another image provider API node like Unsplash.
              4. Update Additional WordPress Post Fields
                In the WordPress node, include tags or categories dynamically from Airtable columns.
              5. Limit Posts Per Run
                Adjust the Airtable “limit” parameter to control how many posts are processed each workflow run.

              Troubleshooting 🔧

              Problem: “WordPress API returns 401 Unauthorized”
              Cause: Incorrect WordPress API credentials or lack of permissions.
              Solution: Recheck API user password, enable application password in WordPress, and update credentials in n8n node.

              Problem: “Image upload fails or returns invalid response”
              Cause: Header misconfiguration or binary data not sent properly.
              Solution: Ensure content-type and content-disposition headers are correct and binary data field is set to image data.

              Problem: “Airtable records not updating”r>Cause: Mismatched record IDs or incorrect mapping.
              Solution: Verify that Airtable record IDs are correctly passed from previous nodes and mapped to the update node.

              Pre-Production Checklist ✅

              • Verify Airtable base columns and filter formula for “To Post” status.
              • Test WordPress REST API credentials and post creation with a test blog.
              • Test Pexels API key by fetching an image manually.
              • Run workflow manually in n8n with debug enabled to track data flow.
              • Backup Airtable data before initial runs.

              Deployment Guide

              Activate the workflow in n8n after completing setup and testing.

              Monitor workflow executions in the n8n dashboard to catch any errors or interruptions.

              Schedule the trigger at your preferred publishing frequency (e.g., daily or multiple times per day).

              FAQs

              Q: Can I use Google Sheets instead of Airtable?
              A: This workflow uses Airtable’s search and update API features extensively. Google Sheets would require a different setup but could be integrated with n8n similarly.

              Q: Does uploading images consume a lot of API credits?
              A: Pexels API has limits on free and paid plans. Monitor your usage within the API dashboard.

              Q: Is my WordPress data secure in this automation?
              A: API credentials are stored securely in n8n, but always follow best security practices and limit API permissions smartly.

              Conclusion

              By following this detailed guide, you’ve automated Sarah’s tedious blog posting workflow, turning hours of manual work into a seamless automated process. Now, AI-generated content from Airtable is effortlessly published as WordPress draft posts, complete with relevant featured images, and Airtable statuses are updated automatically. This automation can save you at least 5 hours per week while reducing errors and improving consistency.

              Next, consider expanding this workflow to schedule posts automatically, integrate social media posting, or generate SEO meta descriptions using AI nodes.

              Happy automating!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free