Automatically publish blog posts from Notion to WordPress, Ghost, or Webflow with SEO optimization.
Streamline your content publishing workflow by automatically syncing blog posts from Notion to your website. This workflow monitors a Notion database for posts marked as 'Ready to Publish', extracts the content with proper formatting, optimizes metadata for SEO, handles image uploads, and publishes to your chosen CMS (WordPress, Ghost, or Webflow). Includes automatic status updates back to Notion.
{
"name": "Notion to Blog Auto-Publisher",
"nodes": [
{
"parameters": {
"content": "## Template by Harshith Vaddiparthy\n\n\n**Learn to Build AI Automations**\nMaster n8n, AI agents, and no-code automation in my comprehensive course.\n→ harshith.com/vibecode\n\n\n**Content Automation Consulting**\nI help businesses automate video creation, social media, blogs, and newsletters.\n→ harshith.com/meet\n\n\n**Connect with me**\n→ linkedin.com/in/harshith-vaddiparthy",
"height": 420,
"width": 400,
"color": 4
},
"id": "promo-sticky",
"name": "Sticky Note - Credits",
"type": "n8n-nodes-base.stickyNote",
"position": [
-500,
-200
],
"typeVersion": 1
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"event": "pagedUpdatedInDatabase",
"databaseId": {
"__rl": true,
"value": "YOUR_NOTION_DATABASE_ID",
"mode": "list"
},
"simple": true
},
"id": "notion-trigger",
"name": "Watch Notion Database",
"type": "n8n-nodes-base.notionTrigger",
"position": [
0,
100
],
"credentials": {
"notionApi": {
"id": "YOUR_NOTION_CREDENTIAL_ID",
"name": "Notion"
}
},
"typeVersion": 1
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "status-check",
"leftValue": "={{ $json.properties.Status.select.name }}",
"rightValue": "Ready to Publish",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"id": "check-status",
"name": "Check if Ready",
"type": "n8n-nodes-base.if",
"position": [
200,
100
],
"typeVersion": 2.2
},
{
"parameters": {
"resource": "block",
"blockId": "={{ $json.id }}",
"operation": "getAll"
},
"id": "get-content",
"name": "Get Page Content",
"type": "n8n-nodes-base.notion",
"position": [
400,
100
],
"credentials": {
"notionApi": {
"id": "YOUR_NOTION_CREDENTIAL_ID",
"name": "Notion"
}
},
"typeVersion": 2.2
},
{
"parameters": {
"jsCode": "// Convert Notion blocks to HTML\nconst blocks = $input.all();\nlet html = '';\nlet plainText = '';\n\nfor (const item of blocks) {\n const block = item.json;\n const type = block.type;\n \n if (type === 'paragraph' && block.paragraph?.rich_text) {\n const text = block.paragraph.rich_text.map(t => t.plain_text).join('');\n html += `<p>${text}</p>`;\n plainText += text + ' ';\n } else if (type === 'heading_1' && block.heading_1?.rich_text) {\n const text = block.heading_1.rich_text.map(t => t.plain_text).join('');\n html += `<h1>${text}</h1>`;\n } else if (type === 'heading_2' && block.heading_2?.rich_text) {\n const text = block.heading_2.rich_text.map(t => t.plain_text).join('');\n html += `<h2>${text}</h2>`;\n } else if (type === 'bulleted_list_item' && block.bulleted_list_item?.rich_text) {\n const text = block.bulleted_list_item.rich_text.map(t => t.plain_text).join('');\n html += `<li>${text}</li>`;\n }\n}\n\nconst title = $('Watch Notion Database').item.json.properties.Title?.title[0]?.plain_text || 'Untitled';\nconst slug = title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');\nconst excerpt = plainText.substring(0, 160) + '...';\n\nreturn [{\n json: {\n title,\n slug,\n html,\n excerpt,\n notionPageId: $('Watch Notion Database').item.json.id\n }\n}];"
},
"id": "convert-content",
"name": "Convert to HTML",
"type": "n8n-nodes-base.code",
"position": [
600,
100
],
"typeVersion": 2
},
{
"parameters": {
"method": "POST",
"url": "={{ $credentials.url }}/wp-json/wp/v2/posts",
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\"title\": \"{{ $json.title }}\", \"content\": \"{{ $json.html }}\", \"status\": \"publish\", \"slug\": \"{{ $json.slug }}\", \"excerpt\": \"{{ $json.excerpt }}\"}"
},
"id": "publish-wordpress",
"name": "Publish to WordPress",
"type": "n8n-nodes-base.httpRequest",
"position": [
800,
100
],
"credentials": {
"httpBasicAuth": {
"id": "YOUR_WORDPRESS_CREDENTIAL_ID",
"name": "WordPress"
}
},
"typeVersion": 4.2
},
{
"parameters": {
"resource": "databasePage",
"pageId": "={{ $('Convert to HTML').item.json.notionPageId }}",
"propertiesUi": {
"propertyValues": [
{
"key": "Status|select",
"selectValue": "Published"
}
]
}
},
"id": "update-notion",
"name": "Update Notion Status",
"type": "n8n-nodes-base.notion",
"position": [
1000,
100
],
"credentials": {
"notionApi": {
"id": "YOUR_NOTION_CREDENTIAL_ID",
"name": "Notion"
}
},
"typeVersion": 2.2
},
{
"parameters": {
"content": "## Notion to Blog Publisher\n\n### Setup:\n1. Create a Notion database with Title, Status, and Content\n2. Configure WordPress API credentials\n3. Set your Notion database ID\n\n### Flow:\n1. Monitors Notion for 'Ready to Publish' posts\n2. Extracts and converts content to HTML\n3. Publishes to WordPress with SEO metadata\n4. Updates Notion status to 'Published'\n\n### Customization:\n- Modify the Code node to support Ghost or Webflow\n- Add image handling for featured images",
"height": 340,
"width": 400,
"color": 7
},
"id": "info-sticky",
"name": "Info",
"type": "n8n-nodes-base.stickyNote",
"position": [
-500,
40
],
"typeVersion": 1
}
],
"connections": {
"Watch Notion Database": {
"main": [
[
{
"node": "Check if Ready",
"type": "main",
"index": 0
}
]
]
},
"Check if Ready": {
"main": [
[
{
"node": "Get Page Content",
"type": "main",
"index": 0
}
]
]
},
"Get Page Content": {
"main": [
[
{
"node": "Convert to HTML",
"type": "main",
"index": 0
}
]
]
},
"Convert to HTML": {
"main": [
[
{
"node": "Publish to WordPress",
"type": "main",
"index": 0
}
]
]
},
"Publish to WordPress": {
"main": [
[
{
"node": "Update Notion Status",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"pinData": {},
"meta": {
"instanceId": "template-notion-publisher"
}
}Copy this JSON and import it into n8n via Settings → Import from File/URL → Paste JSON