Skip to content

On a schedule

Add a short summary to the top of every WordPress post

Every night, posts without a summary get a three-line summary at the top, and each one is logged in a sheet so you can see what has been done.

Runs
On a schedule
Apps
Google Sheets, WordPress
AI
Yes, uses the built-in AI allowance
Access
WordPress editor; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: every night, for WordPress posts not yet in my Summaries sheet, write a 3-line summary, insert it at the top of the post, log it in the sheet and message me in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A B2B software company has a blog with several hundred long articles. Readers skim, and analytics show many leave before reaching the useful part. The team wants a short "key takeaways" box at the top of every post, but adding one by hand to hundreds of articles is not going to happen.

This automation works through the archive a batch at a time. Each night it lists posts, skips those already in the Summaries sheet, AI writes a three-line summary for the next batch, and the summary is inserted at the top of each post. Every change is logged in the sheet and a Slack message reports the night's progress.

What you get out of it

  • Readers get the point quickly

    A short summary helps skimmers decide to keep reading and gives busy readers the key points either way. Both make the post more useful.

  • The whole archive, not just new posts

    Working through a batch each night covers hundreds of old posts over a few weeks. No one has to set aside days to do it.

  • Every change logged

    The sheet records each post, its summary and the date. It is easy to review the work and undo a summary if needed.

  • Steady, gentle pace

    A limited batch each night keeps changes reviewable. Your team sees the progress in Slack each morning.

How it works

What happens, step by step

  1. Every night, ClickRuntime lists your published WordPress posts and reads your Summaries sheet.

  2. It skips any post already logged in the sheet and picks the next batch.

  3. AI writes a three-line summary for each post from its content.

  4. The summary is inserted at the top of each post, each change is logged in the sheet, and a Slack message reports how many posts were updated.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect WordPress

What you get

RunsOn a schedule
Add a short summary to the top of every WordPress posttoday, 9:00Succeeded
Slack · #contentAdded summaries to 10 blog posts tonight.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and WordPress steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
add_ai_summary_blocks_to_wordpress_posts.pyexample
import re
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify

SHEET_ID = "your-spreadsheet-id"
WP = "https://blog.example.com/wp-json/wp/v2"

def wp(method, path, **kw):
    r = http.request(method, f"{WP}/{path}", auth=(credentials.secret("WP_USER"), credentials.secret("WP_APP_PASSWORD")), **kw)
    r.raise_for_status()
    return r.json()

@on_trigger
def run(event):
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    logged = {r[0] for r in sheets.values().get(spreadsheetId=SHEET_ID, range="Summaries!A2:A").execute().get("values", []) if r}
    posts = [p for p in wp("GET", "posts", params={"per_page": 100, "context": "edit"}) if str(p["id"]) not in logged][:10]
    rows = []
    for p in posts:
        text = re.sub("<[^>]+>", " ", p["content"]["raw"])[:5000]
        summary = ai.generate(f"Summarise in exactly 3 short bullet points:\n{text}", max_output_tokens=150).text.strip()
        items = "".join(f"<li>{line.lstrip('-• ').strip()}</li>" for line in summary.splitlines() if line.strip())
        wp("POST", f"posts/{p['id']}", json={"content": f'<div class="key-takeaways"><strong>Key takeaways</strong><ul>{items}</ul></div>\n' + p["content"]["raw"]})
        rows.append([str(p["id"]), p["title"]["raw"], summary, date.today().isoformat()])
    if rows:
        sheets.values().append(spreadsheetId=SHEET_ID, range="Summaries!A:D", valueInputOption="RAW", body={"values": rows}).execute()
        notify.slack(f"Added summaries to {len(rows)} blog posts tonight.", channel="#content")
    return {"updated": len(rows)}

FAQ

Common questions

How many posts does it do each night?
Ten by default, so changes stay easy to review. You can raise it once you are happy with the summaries.
What does the summary look like?
Three short bullet points in a highlighted block at the top of the post. You can change the heading and style.
Will it add a summary to new posts too?
Yes. Any post that is not in the sheet yet, including ones published since the last run, gets picked up.
What permissions does it need?
WordPress editor; Sheets edit. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Add a short summary to the top of every WordPress post” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.