Every 15 min for new published posts
Share each new WordPress post on your Facebook Page
Every time you publish a blog post, a Facebook post with a short caption and the link goes out on your Page within 15 minutes.
- Runs
- Every 15 min for new published posts
- Apps
- Facebook Pages, WordPress
- AI
- Yes, uses the built-in AI allowance
- Access
- WordPress read; Page token with pages_manage_posts, pages_read_engagement
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check for newly published WordPress posts, write a short Facebook caption for each with AI, and post it with the link to my Facebook Page.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A neighbourhood bakery posts recipes and news on its WordPress blog, and most of its regulars follow its Facebook Page. Sharing each post on Facebook is meant to happen straight after publishing, but it is easy to forget in the middle of a morning rush.
This automation shares for them. Every 15 minutes it checks WordPress for new posts, AI writes a friendly caption from the title and excerpt, and the post goes out on the Facebook Page with the link. If AI is unavailable, the excerpt is used as the caption, so the post is still shared.
What you get out of it
Every post reaches your followers
No blog post is published without being shared. Your Facebook audience sees everything you write.
A caption that fits the feed
AI writes a short, friendly caption instead of pasting the title. Posts look like you wrote them for Facebook.
Readers come to your site
Each Facebook post links to the article, so followers visit your website, where your menu and orders are.
Still works without AI
If AI is not available, the post's excerpt is used as the caption. Sharing never stops.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your WordPress site for posts published since its last check.
It remembers the newest post it has shared, so each post is only shared once.
AI writes a short Facebook caption from the post's title and excerpt, or the excerpt is used if AI is unavailable.
The caption and link are posted to your Facebook Page.
Before it runs live
- Connect Facebook Pages
- 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
- 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 Facebook Pages and WordPress steps into one automation
Under the hood
The code that runs this automation
import re
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, http, state, ai, log, report_fetched
PAGE_ID = "your-page-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()
def post_to_page(message, link):
r = http.post(f"https://graph.facebook.com/v21.0/{PAGE_ID}/feed", data={"message": message, "link": link, "access_token": credentials.secret("FACEBOOK_PAGE_TOKEN")})
r.raise_for_status()
return r.json()["id"]
@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 {"shared": 0}
for p in posts:
excerpt = re.sub("<[^>]+>", "", p["excerpt"]["rendered"]).strip()
try:
caption = ai.generate(f"Write a warm 1-2 sentence Facebook caption for: {p['title']['rendered']}\n{excerpt[:600]}", max_output_tokens=80).text.strip()
except (ai.AINotIncluded, ai.AILimitReached) as e:
log.warning("AI unavailable, using excerpt", {"code": e.code})
caption = excerpt[:300]
post_to_page(caption, p["link"])
state.set("after", posts[-1]["date"])
return {"shared": len(posts)}FAQ
Common questions
Will it share old posts?
Can I set the tone of captions?
Does Facebook show a preview?
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
Rewrite new feed articles for your site and Facebook Page
New articles from the feeds you follow become rewritten posts on your WordPress site, and each one is shared on your Facebook Page with the link.
See how it worksPublish a scheduled blog post and share it on Facebook
On your schedule, the next topic on your list becomes a WordPress post and is shared on your Facebook Page with a caption and link.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksKeep exploring
Set up “Share each new WordPress post on your Facebook Page” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.