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.
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
Every night, ClickRuntime lists your published WordPress posts and reads your Summaries sheet.
It skips any post already logged in the sheet and picks the next batch.
AI writes a three-line summary for each post from its content.
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
Build your own
Need it to work differently?
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
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?
What does the summary look like?
Will it add a summary to new posts too?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Turn a blog plan sheet into WordPress drafts
Each morning the next topic in your blog plan sheet becomes an SEO article draft in WordPress, with the link written back to the sheet.
See how it worksTurn new items from your sources into WordPress drafts
New articles and videos from the feeds in your Sources sheet become original blog drafts in WordPress, each one logged in the sheet.
See how it worksTurn this week's trending searches into WordPress drafts
Every Monday the week's rising searches in your niche are logged in a sheet and the top three become blog drafts in WordPress.
See how it worksKeep exploring
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.