How to Automate WordPress with n8n

n8n WordPress Automation: Build Content Pipelines That Actually Work

I publish content to three different WordPress sites. A year ago, that meant logging into each one, manually formatting posts, uploading images, setting categories, and hitting publish. Then I would switch to Slack to tell my team the post was live. Then I would update my content calendar spreadsheet. Then I would schedule social media shares. It was exhausting.

Today, I do none of that manually. My n8n workflows handle the entire pipeline — from content calendar to published post to team notification — without me touching the WordPress admin panel.

I am Javier, a startup consultant based in Chile, and WordPress automation with n8n is genuinely one of the setups I am most proud of. It has transformed my content workflow from a weekly headache into a smooth, mostly hands-off process. In this tutorial, I will show you exactly how I set it up and how you can do the same.

Why Automate WordPress with n8n?

WordPress powers a massive portion of the web, and for good reason — it is flexible, mature, and has an incredible ecosystem. But managing WordPress content involves a lot of repetitive tasks:

– Logging in, writing posts, setting metadata, and publishing
– Moderating comments across multiple posts
– Backing up content and databases
– Syncing content with other platforms
– Updating teams when new content goes live

n8n connects to WordPress through its REST API, which means you can programmatically do anything you would normally do in the admin panel — and a lot more. You can:

Publish posts from external content sources
Manage comments with automated moderation rules
Build content pipelines that go from idea to published post
Automate backups of your posts and media
Sync content across multiple WordPress sites
Trigger workflows when posts are published or updated

For a full breakdown of how n8n compares to other automation tools, read my n8n vs Zapier comparison.

Getting Started: Connecting n8n to WordPress

The connection between n8n and WordPress uses the WordPress REST API, which is built into every WordPress installation since version 4.7. You do not need any extra plugins for basic operations.

If you do not have n8n set up yet, the fastest way to get started is with n8n cloud. It takes minutes to launch an instance, and you can connect it to your WordPress sites immediately. For a self-hosted setup guide, check my n8n beginner guide.

Step 1: Enable WordPress REST API Authentication

By default, the WordPress REST API allows read access to public content, but you need authentication for write operations (creating posts, managing comments, etc.).

The simplest method is Application Passwords (available since WordPress 5.6):

1. Log into your WordPress admin panel
2. Go to Users > Profile
3. Scroll down to Application Passwords
4. Enter a name (e.g., “n8n Automation”)
5. Click Add New Application Password
6. Copy the generated password immediately — it will not be shown again

[SCREENSHOT: WordPress User Profile page showing the Application Passwords section with a newly generated password]

Step 2: Configure WordPress Credentials in n8n

1. In n8n, add a WordPress node to a new workflow
2. Click Credentials > Create New
3. Select WordPress API
4. Enter your WordPress site URL (e.g., https://yoursite.com)
5. Enter your WordPress username
6. Paste the Application Password you just generated
7. Test the connection

[SCREENSHOT: n8n WordPress credential configuration showing URL, username, and password fields]

If the connection test succeeds, you are ready to start building workflows.

Troubleshooting tip: If the connection fails, check that:
– Your site uses HTTPS (required for Application Passwords)
– The REST API is not blocked by a security plugin
– Pretty permalinks are enabled (Settings > Permalinks > anything other than “Plain”)

The Main Workflow: Content Calendar to Published Post

This is the workflow I use personally, and it is the one I am most excited to share. It takes a content calendar in Google Sheets, checks for posts scheduled for today, generates draft content, publishes to WordPress, and notifies my team on Slack.

Architecture

Schedule Trigger --> Google Sheets (Read) --> IF (Today?) --> HTTP Request (Generate Draft) --> WordPress (Create Post) --> Slack (Notify)


Let me walk through each step in detail.

Step 1: The Content Calendar

My content calendar is a Google Sheet with these columns:

| Title | Topic | Keywords | Scheduled Date | Status | WordPress URL |
|-------|-------|----------|---------------|--------|---------------|
| 10 Tips for... | Productivity | productivity, tips | 2026-04-06 | Draft | |
| How to Build... | Automation | n8n, workflow | 2026-04-07 | Draft | |

The Status column tracks where each post is in the pipeline: Idea, Draft, Review, Scheduled, Published.

Step 2: Schedule Trigger

I set a Schedule Trigger to run every morning at 7:00 AM Chile time:

1. Add a Schedule Trigger node
2. Set the interval to Daily at 07:00

[SCREENSHOT: Schedule Trigger node set to daily at 7:00 AM]

Step 3: Read the Content Calendar

1. Add a Google Sheets node
2. Set Operation to "Read Rows"
3. Select the content calendar spreadsheet
4. This returns all rows from the sheet

Step 4: Filter for Today's Posts

Add an IF node to check two conditions:

1. Scheduled Date equals today's date: {{ $json['Scheduled Date'] }} equals {{ $now.format('yyyy-MM-dd') }}
2. Status equals "Draft" or "Review"

Only posts that match both conditions pass through to the next step.

[SCREENSHOT: IF node with date comparison and status filter conditions]

Step 5: Prepare the Post Content

This is where things get interesting. I use an HTTP Request node to call an AI service that generates a draft based on the topic and keywords. But you can also use a Set node to format content that has already been written.

For the Set node approach (manual content):

Title: {{ $json.Title }}
Content: {{ $json.Content }}
Categories: [{{ $json.Category }}]
Tags: {{ $json.Keywords }}
Status: draft


For the AI-assisted approach, I send the topic and keywords to an API that returns formatted HTML content. More on this in my n8n OpenAI integration guide.

Step 6: Publish to WordPress

1. Add a WordPress node
2. Set Resource to "Post"
3. Set Operation to "Create"
4. Configure the fields:

- Title: {{ $json.Title }}
- Content: {{ $json.Content }}
- Status: publish (or draft if you want to review first)
- Categories: Map from your sheet data
- Tags: Map from keywords
- Featured Image: If you have an image URL, use a separate HTTP Request node to upload it first

[SCREENSHOT: WordPress Create Post node with all fields mapped from the content calendar data]

My workflow actually publishes as "draft" first. I review the post in WordPress, make any final edits, and then publish manually. This gives me a safety net while still automating 90% of the work.

Step 7: Update the Content Calendar

After the WordPress node succeeds, I add another Google Sheets node to:

1. Update the Status column to "Published"
2. Add the WordPress URL from the response
3. Add the publish timestamp

This keeps the content calendar in sync with reality.

Step 8: Notify on Slack

Finally, a Slack node posts to the #content channel:

:page_facing_up: New post published!

*{{ $json.title }}*
:link: {{ $json.link }}
:calendar: Published at {{ $now.format('HH:mm') }}

Ready for social media sharing.


[SCREENSHOT: Complete workflow showing all nodes connected from Schedule Trigger through Google Sheets, IF, Set, WordPress, Google Sheets Update, and Slack]

Managing WordPress Comments with n8n

Comment moderation is one of those tasks that eats time if you let it pile up. Here is how I automate it.

Auto-Moderate Comments

1. Schedule Trigger runs every hour
2. WordPress node reads pending comments (Operation: Get All, Status: Hold)
3. IF node checks for spam indicators:
- Contains common spam keywords
- Has more than 3 links
- Author email is from a known spam domain
4. WordPress node marks spam comments as "spam"
5. WordPress node approves legitimate comments
6. Slack node sends a summary of moderated comments

Reply to Comments Automatically

For common questions, I have a workflow that:

1. Reads new approved comments
2. Uses a keyword matching system to identify the question type
3. Posts a templated reply
4. Flags unusual comments for manual review

This works well for FAQ-type comments but I always review the auto-replies to make sure they are relevant.

Backup Automation

Never rely on a single copy of your content. Here is my backup workflow:

Weekly Content Backup

1. Schedule Trigger runs every Sunday at 2:00 AM
2. WordPress node gets all posts (Operation: Get All)
3. Code node converts the posts to a structured JSON format
4. Google Drive node uploads the backup file with a timestamp in the filename
5. Email node sends me a confirmation with the backup stats

Backup complete: {{ $json.postCount }} posts exported.
File: wordpress-backup-{{ $now.format('yyyy-MM-dd') }}.json
Size: {{ $json.fileSize }}

Incremental Backups

For more frequent backups, I run a daily workflow that only exports posts modified in the last 24 hours. This is faster and uses less storage.

1. Schedule Trigger runs daily
2. WordPress node gets posts with modified_after parameter set to yesterday
3. Code node formats the data
4. Google Drive node appends to the weekly backup folder

Multi-Site Content Syndication

I manage content for three WordPress sites, and some content needs to appear on multiple sites. Here is how I handle syndication:

1. WordPress Trigger detects a new post on the primary site
2. IF node checks if the post has a "syndicate" tag
3. Loop node iterates through the target sites
4. WordPress node creates the post on each target site
5. Set node adds a canonical URL pointing to the original

This workflow saves me from manually republishing content and ensures canonical URLs are set correctly for SEO.

WordPress REST API: Going Beyond the Built-In Node

The n8n WordPress node covers common operations, but the WordPress REST API supports much more. For advanced operations, use the HTTP Request node directly:

Custom Post Types

If your site uses custom post types (like "portfolio" or "testimonial"), use an HTTP Request node:

Method: POST
URL: https://yoursite.com/wp-json/wp/v2/portfolio
Headers:
Authorization: Basic {{ Buffer.from('username:app-password').toString('base64') }}
Body:
{
"title": "New Portfolio Item",
"content": "Description here",
"status": "publish"
}

Custom Fields (ACF)

If you use Advanced Custom Fields, include them in the request body:

{
"title": "Post with Custom Fields",
"content": "Content here",
"acf": {
"custom_field_name": "value",
"another_field": 42
}
}

WooCommerce Integration

For WooCommerce sites, the REST API extends to products, orders, and customers:

URL: https://yoursite.com/wp-json/wc/v3/products
Authentication: Consumer Key / Consumer Secret


This opens up e-commerce automation -- syncing inventory, processing orders, and generating reports.

Performance and Security Considerations

API Rate Limiting

WordPress does not have built-in rate limiting, but your hosting provider might. If you are making many API calls:

- Add Wait nodes between bulk operations
- Use pagination for large datasets (the WordPress API returns 10 items per page by default)
- Cache frequently accessed data in a Set node rather than re-fetching it

Security Best Practices

- Use Application Passwords instead of your main login password
- Create a dedicated WordPress user for n8n with only the permissions it needs (Editor role is usually sufficient)
- Use HTTPS for all API calls
- Rotate Application Passwords periodically
- Monitor API access in your WordPress security logs

Handling Errors

WordPress API calls can fail for various reasons:

- Server downtime
- Rate limiting
- Invalid data (missing required fields)
- Permission issues

I always add error handling to my WordPress workflows:

1. Enable Continue on Fail on WordPress nodes that might fail
2. Add an IF node after to check if the operation succeeded
3. Route failures to a Slack node that alerts me
4. Store failed items in a Google Sheet for retry

FAQ

Can n8n work with WordPress.com hosted sites?

Yes, but the setup is different. WordPress.com sites use the WordPress.com REST API, which requires OAuth2 authentication through the WordPress.com developer portal. The endpoints are slightly different from self-hosted WordPress. For self-hosted WordPress (WordPress.org), you use Application Passwords with the standard REST API as described in this tutorial. If you have a WordPress.com Business or eCommerce plan, you can install plugins and use the standard REST API approach as well.

How do I publish WordPress posts with featured images using n8n?

Publishing a post with a featured image is a two-step process. First, upload the image using the WordPress node with Resource set to "Media" and Operation set to "Upload." This returns a media ID. Then, create or update the post and set the "Featured Media" field to that media ID. If your image is hosted online, you can use an HTTP Request node to download it first, then pass the binary data to the WordPress media upload node.

Can I use n8n to migrate content between WordPress sites?

Absolutely. I have done this several times for clients. Create a workflow with a WordPress node reading all posts from the source site and another WordPress node creating posts on the destination site. Map the fields between source and destination, including title, content, categories, tags, and featured images. For large migrations, use the SplitInBatches node to process posts in groups of 10 to 20, with Wait nodes between batches to avoid overwhelming either server. Remember to handle media files separately since image URLs will need to be re-uploaded to the destination site.

My Personal Workflow in Practice

I want to be transparent about how I actually use this setup day to day. My content pipeline is not fully automated end to end -- I still write the actual content myself (or review AI-assisted drafts). What n8n automates is all the mechanical work around publishing:

1. Monday morning, my workflow checks the content calendar and sends me a Slack DM with this week's schedule
2. I write or finalize content throughout the week
3. When I mark a post as "Ready" in the sheet, n8n picks it up, creates the WordPress draft, and sends me a preview link
4. I review the draft in WordPress, make final tweaks, and change status to "Scheduled"
5. At the scheduled time, WordPress publishes the post
6. n8n detects the new published post and sends the Slack notification
7. The content calendar updates automatically

This hybrid approach gives me automation where it matters while keeping human judgment where it counts. The content still has my voice and perspective, but all the logistics around publishing are handled automatically.

Wrapping Up

WordPress automation with n8n has genuinely changed how I manage content. What used to be a full afternoon of manual publishing across multiple sites now happens in the background while I focus on writing and strategy.

The content calendar workflow I shared is the backbone of my setup, but the possibilities extend to comment moderation, backups, multi-site syndication, and e-commerce automation. Once you have the WordPress connection established, you can build on it incrementally.

If you want to get started with this setup, try n8n and begin with a simple workflow -- maybe just reading your recent posts or creating a test draft. Once you see how straightforward the API connection is, you will start finding automation opportunities everywhere in your WordPress workflow.

For more context on why I recommend n8n for automation, read my detailed n8n review. And if you are new to n8n, start with my beginner guide to get the fundamentals down first.

Happy automating.

🚀 Ready to automate?

Start your free n8n trial today.

Try n8n Free →

Deja un comentario