Skip to content

Every hour

Write social captions for new WordPress posts in a sheet

Each time you publish a blog post, captions for LinkedIn, X and Facebook are written and added to your social queue sheet, ready to schedule.

Runs
Every hour
Apps
Google Sheets, WordPress
AI
Yes, uses the built-in AI allowance
Access
WordPress read; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: every hour, find newly published WordPress posts, write captions for LinkedIn, X and Facebook for each, and add them to my Social queue sheet.

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 nonprofit's communications officer publishes two or three blog posts a week and is supposed to share each one on social media. Writing three versions of a caption for every post is the step that gets dropped, so many articles are published and never promoted.

This automation writes the captions as soon as a post goes live. Every hour it checks WordPress for new posts, AI writes a caption for each network, and they are added to the Social queue sheet with the post link. The officer copies them into their scheduling tool or a volunteer posts them by hand.

What you get out of it

  • Every post gets promoted

    Captions appear for every article without anyone remembering to write them. Posts reach more readers because they are actually shared.

  • Right length for each network

    LinkedIn, X and Facebook each get a caption that suits their style and limits. No more trimming one caption three ways.

  • A queue anyone can work from

    The sheet holds captions, links and dates in one place. Volunteers or colleagues can schedule posts without asking what to say.

  • Nothing is posted without a person

    Captions go into a sheet, not straight onto your accounts. Someone always chooses when and where each one goes out.

How it works

What happens, step by step

  1. Every hour, ClickRuntime checks your WordPress site for posts published since its last check.

  2. It remembers the time of the newest post it has handled, so each post is only processed once.

  3. AI writes a caption for LinkedIn, X and Facebook from each post's title and excerpt.

  4. The captions are added as a new row in your Social queue sheet, along with the post title, link and date.

Before it runs live

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

What you get

RunsEvery hour
Write social captions for new WordPress posts in a sheettoday, 9:00Succeeded
Google Sheets · Social queueVolunteer Week recap | LinkedIn: Last week 140 volunteers helped Northwind Food Bank pack 9 tonnes of food...

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

  • Act only on the items that match your own rules, and skip the rest
  • 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.
share_new_wordpress_posts_to_social_logged_in_a_sheet.pyexample
from datetime import datetime, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched

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):
    after = state.get("after") or datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
    posts = wp("GET", "posts", params={"after": after, "status": "publish", "orderby": "date", "order": "asc", "_fields": "date,link,title,excerpt"})
    report_fetched(len(posts))
    if not posts:
        return {"new": 0}
    schema = {"type": "object", "properties": {k: {"type": "string"} for k in ["linkedin", "x", "facebook"]}, "required": ["linkedin", "x", "facebook"]}
    rows = []
    for p in posts:
        c = ai.generate(f"Title: {p['title']['rendered']}\nExcerpt: {p['excerpt']['rendered'][:600]}\nWrite captions for LinkedIn, X (under 240 chars) and Facebook.", json_schema=schema, max_output_tokens=400).json
        rows.append([p["date"][:10], p["title"]["rendered"], p["link"], c["linkedin"], c["x"], c["facebook"]])
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    sheets.values().append(spreadsheetId=SHEET_ID, range="Social queue!A:F", valueInputOption="RAW", body={"values": rows}).execute()
    state.set("after", posts[-1]["date"])
    return {"new": len(posts)}

FAQ

Common questions

Does it post to the social networks?
No. It writes captions into the sheet so a person or a scheduling tool can post them. Other automations can post directly if you prefer.
Will it write captions for old posts?
No. It starts with posts published after you turn it on.
Can I set the tone?
Yes. Describe your organisation's voice once and every caption follows it.
What permissions does it need?
WordPress read; 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 checks. Checks that find nothing new 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 “Write social captions for new WordPress posts in a sheet” from your assistant

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