Blog Image SEO and Size Auditor for Ghost - n8n Workflow

Automate image SEO audits for Ghost blogs using this powerful n8n workflow. Extract alt text, check file size, and record audit results directly into Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content managers running blogs on Ghost who need to ensure image optimization.

  • SEO specialists looking to automate image auditing processes.

  • Developers seeking robust n8n templates for content governance and reporting.

  • Users needing to implement custom logic (like size checks) within an n8n workflow.

Overview

Maintaining optimal image performance—both in terms of file size and SEO attributes like alt text and filenames—is crucial for search engine rankings and user experience. Manually auditing every image across dozens or hundreds of blog posts is inefficient. This comprehensive n8n workflow automates the entire process.

This powerful n8n templates solution connects to your Ghost blog, extracts all embedded images and their existing alt text, and then performs two key audits: checking if the image file size is below a defined threshold (500 KB in this case) and verifying if the filename follows SEO best practices. All findings are meticulously logged into a Google Sheet, providing a central, actionable report. By leveraging this repeatable n8n node sequence, you ensure your content always meets technical SEO standards.

How it Works

The entire process is initiated by the manual n8n trigger, making it easy to run on demand.


  1. Extraction (Ghost n8n node): The workflow starts by using the Ghost n8n node to extract recent blog posts, including their full HTML content.

  2. Data Preparation (Set n8n node): A subsequent Set n8n node extracts core data fields like id, title, and content (HTML) for further processing.

  3. Image Collection Loop (First Split In Batches): The first Split In Batches n8n node iterates over each article. Inside this loop, a Code n8n node uses JavaScript regex to parse the article's HTML, successfully collecting every imageurl and alttext present in the post.

  4. Initial Logging (Google Sheets n8n node): This extracted image data is immediately appended to the Google Sheets document, establishing a foundational record for each image.

  5. Audit Preparation (Google Sheets Lookup): The n8n workflow then retrieves the newly recorded image links for the specific article from Google Sheets, ensuring it only processes images already logged.

  6. Detailed Auditing Loop (Second Split In Batches): A second Split In Batches n8n node processes each collected image link individually.

  7. Image Download (HTTP Request n8n node): The HTTP Request n8n node downloads the actual image file content as binary data, which is necessary to analyze its properties.

  8. Metric Calculation (Code n8n node): A Code n8n node analyzes the binary file data to determine the filesizekb. It then applies logical checks: confirming if the file size is under 500 KB (sizeok) and checking if the filename is SEO-friendly (filenameseo).

  9. Reporting (Google Sheets n8n node): Finally, a Google Sheets n8n node performs an Append or Update operation, matching on the imageurl to update the existing record with the audit results (filesizekb, format, sizeok, filename_seo). This completes the image audit within this efficient n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code and import it into your n8n instance via the 'Workflows' section.

  2. Ghost Credentials: Configure the Ghost n8n node ('Extract Blog Posts') with your Content API key and base URL. Ensure you set the limit appropriately for production use (it is set to 1 for testing).

  3. Google Sheets Setup: Create a new Google Sheet to hold the audit data.

  4. Google Sheets Credentials: Provide OAuth2 API credentials for the Google Sheets n8n node in all three locations ('Add Records', 'Collect Records by Id', and 'Results Images').

  5. Sheet Configuration: For all three Google Sheets n8n node instances, link the node to the correct Spreadsheet ID and Sheet Name.

  6. Test: Execute the n8n trigger to verify the connection and data flow. The first run will populate the sheet, and subsequent runs will audit the image properties.

Node Details

This robust n8n workflow relies on a mix of application-specific and core nodes to achieve its goal.

When clicking ‘Test workflow’ (Manual Trigger n8n trigger):
Function: Initiates the n8n workflow execution manually.
Key Configuration: Standard manual activation.

Extract Blog Posts (Ghost n8n node):
Function: Connects to the Ghost Content API to pull blog posts, including all necessary content and metadata.
Key Configuration: Operation: getAll, Limit: 1 (needs adjustment for production).

Collect All Images (Code n8n node):
Function: Executes custom JavaScript using regex to scrape all tags from the article HTML, extracting the imageurl and alttext into structured JSON items.
Key Configuration: Custom JavaScript implementation for content parsing.

Add Records (Google Sheets n8n node):
Function: Appends the initial list of extracted image URLs and alt text to the designated Google Sheet.
Key Configuration: Operation: append, Mapping Mode: defineBelow (mapping articleId, imageurl, alttext).

Get Image (HTTP Request n8n node):
Function: Downloads the content of each image URL found in the second loop.
Key Configuration: Options: Response Format set to file to handle binary data.

Extract Image Info (Code n8n node):
Function: Analyzes the binary file data downloaded by the previous n8n node to calculate the file size in KB, extract the format, and run SEO checks (filename validity, size check against 500 KB limit).
Key Configuration: Custom JavaScript logic using the $binary object for file analysis.

Results Images (Google Sheets n8n node):
Function: Updates the existing Google Sheet records with the auditing results (size, format, SEO checks).
Key Configuration: Operation: appendOrUpdate, Matching Columns: image_url (ensures the correct row is updated based on the image link).

Loop Over Items (Split In Batches n8n node):
* Function: Used twice in this n8n workflow to efficiently process large batches of articles and then large batches of individual image items.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Automation, AI and Analytics for Supply Chain & Business Optimization Helping businesses streamline operations using n8n, AI agents, and data science to enhance efficiency and sustainability. Linkedin: www.linkedin.com/in/samir-saci

Featured*