Export WordPress Posts to CSV and Upload via n8n

This n8n workflow automates exporting published WordPress posts to a CSV file and uploads it directly to Google Drive. It eliminates manual export hassles, saving time and ensuring consistent backups for bloggers and content managers.
wordpress
googleDrive
manualTrigger
+3
Learn how to Build this Workflow with AI:
Workflow Identifier: 1555
NODES in Use: Manual Trigger, WordPress, Set, Convert to File, Google Drive, Sticky Note

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

Visit through Desktop for Best experience

Opening Problem Statement

Meet Sarah, a content manager responsible for maintaining a WordPress blog with hundreds of published posts. Every month, she needs to export all published posts for reporting and backup purposes. Doing this manually means logging into WordPress, exporting posts, formatting the data, and then uploading the file to Google Drive for safekeeping. This repetitive process wastes her several hours each week and increases the risk of human errors—like missing posts or uploading the wrong version.

If Sarah misses even one export cycle, the team loses critical backup data which could be costly in case of site issues or content audits. She’s looking for a seamless way to automate this entire process without coding and without having to switch contexts repeatedly.

What This Automation Does

This n8n workflow exactly solves Sarah’s problem with a simple yet powerful automation:

  • Automatically triggers a manual start to fetch all published WordPress posts using the official WordPress node.
  • Transforms the complex post data into clean, user-friendly fields including ID, title, link, and content.
  • Converts the cleaned data into a CSV file format in memory.
  • Uploads this CSV file directly to a designated Google Drive folder using service account credentials, eliminating manual upload steps.
  • Provides clear notes within the workflow for customization and explanation, making it beginner-friendly.
  • Saves multiple hours monthly and reduces errors by standardizing the export and storage process.

Prerequisites ⚙️

  • n8n account (cloud or self-hosted) to create and run the workflow.
  • WordPress website with API access and credentials set in n8n for the WordPress node.
  • Google Drive account set up with Service Account authentication for the Google Drive node.
  • Basic understanding of CSV files (optional but helpful).

Step-by-Step Guide

Step 1: Start With Manual Trigger Node

Navigate to ‘Nodes’ panel in n8n and add a “Manual Trigger” node named When clicking ‘Test workflow’. This node initiates the workflow when you manually run it.

What you’ll see: A blank manual trigger node ready to be connected.

Common mistake: Forgetting to start the workflow with a trigger will cause later nodes not to execute.

Step 2: Fetch All Published WordPress Posts

Add a WordPress node named Get WordPress Posts. Set the operation to “getAll” and the status filter to “publish” to only fetch published posts.

Credentials: Select or add your WordPress API credentials.

Outcome: This node retrieves all published posts from your WordPress site and outputs them as JSON.

Tip: Make sure your WordPress API token has permission to access posts.

Step 3: Adjust and Simplify Fields

Add a Set node named Adjust Fields. Here, map and transform the WordPress post data into simplified fields:

id: ={{$json.id}}
title: ={{$json.title.rendered}}
link: ={{$json.link}}
content: ={{$json.content.rendered}}

This prepares the data for CSV export by reducing nested objects to basic text fields.

Visual: The Set node assignments screen showing the four fields mapped.

Common Issue: Not fully expanding nested JSON fields will result in incomplete data in the CSV.

Step 4: Convert JSON Data to CSV File

Add the Convert to File node named Convert to CSV File. Choose CSV as the output format and leave the options default.

Outcome: This node converts the adjusted JSON post objects into a downloadable CSV file stored in memory.

Tip: You can preview the downloaded CSV file content in this node’s output during test runs.

Step 5: Upload CSV File to Google Drive

Add a Google Drive node named Upload to Google Drive. Configure it as follows:

  • Name: Set the file name to “WordPress-Posts.csv”
  • Drive ID and Folder ID: Select “My Drive” and folder “root” or your preferred folder.
  • Authentication: Use Service Account credentials previously configured.

Outcome: Once triggered, the CSV file uploads automatically to Google Drive.

Verify: Check Google Drive to confirm the CSV appears after running the workflow.

Step 6: Add Informative Sticky Notes

Add Sticky Note nodes named Sticky Note1 and Sticky Note to include helpful instructions and customization tips inline with the workflow.

Tip: These notes improve maintainability and make the workflow approachable for others.

Customizations ✏️

  • Add More Post Fields: Edit the Adjust Fields Set node to include other WordPress post data like author name, date, categories by adding new assignments with expressions such as {{$json.author_name}}.
  • Change File Name Dynamically: Modify the Google Drive node’s file name field to include dynamic timestamps using expressions like WordPress-Posts-{{$now.format("YYYY-MM-DD")}}.csv for automatic versioning.
  • Filter Posts by Category: In the Get WordPress Posts node, use the options field to filter posts by category or tag to export specific subsets.
  • Save to Specific Google Drive Folder: Change the folder ID in the Upload to Google Drive node to a sub-folder for better organization.
  • Schedule Workflow: Replace the manual trigger with a Cron node to automate exports on a regular schedule (e.g., weekly backups).

Troubleshooting 🔧

  • Problem: “Authentication failed” in WordPress or Google Drive nodes.
    • Cause: Incorrect or expired API credentials.
    • Solution: Re-check and update credentials via n8n Credentials section. Test connection independently before running workflow.
  • Problem: CSV file is empty or missing expected fields.
    • Cause: Incorrect field mappings in the Set node.
    • Solution: Verify all field expressions match your WordPress JSON structure, especially nested fields like title.rendered.
  • Problem: File not appearing in Google Drive after successful run.
    • Cause: Wrong folder ID or Drive ID in Google Drive node.
    • Solution: Confirm the folder selections and permissions on Google Drive, ensure the service account has proper access.

Pre-Production Checklist ✅

  • Confirm WordPress API permissions to access published posts.
  • Test Google Drive service account credentials for write access.
  • Run manual trigger to verify the entire chain fetching posts and uploading file.
  • Preview CSV output in the Convert to File node before live run.
  • Backup previous exports from Google Drive as rollback in case of issues.

Deployment Guide

Activate the workflow in n8n by enabling it after you’ve tested manually. If preferred, schedule it with a Cron trigger for automated regular exports.

Monitor the Google Drive for new files and check n8n’s workflow execution logs for any failed runs or errors to maintain stability.

FAQs

  • Can I use OAuth2 instead of Service Account for Google Drive?
    Yes, Google Drive node supports OAuth2; just configure credentials accordingly.
  • Does this consume many API credits?
    This workflow makes minimal API calls once per run, generally well within free quotas.
  • Is my data secure?
    Using service accounts and n8n’s encrypted credentials storage ensures good security.
  • Can I export posts in other formats?
    Yes, by changing the Convert to File node’s output format to JSON or XML as needed.

Conclusion

By following this detailed walkthrough, you’ve automated exporting WordPress posts into a clean CSV file and uploaded it straight to Google Drive without touching manual exports or drag-and-drop actions. This workflow drastically reduces your workload and human error risks, freeing time for higher-value tasks like creating content.

Next, consider extending this by scheduling regular exports, integrating with email shares, or adding post filtering based on categories or tags within WordPress itself. Keep experimenting and enjoying efficient content management with n8n!

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