On a schedule
Add FAQ sections to your WordPress pages, with copies in Drive
Each week, pages without an FAQ get five questions and answers written from their content, and a copy of each FAQ is kept in a Google Drive document.
- Runs
- On a schedule
- Apps
- Google Drive, WordPress
- AI
- Yes, uses the built-in AI allowance
- Access
- WordPress write; Drive write
Send this to your assistant
Create a ClickRuntime automation: every week, for each WordPress page without an FAQ, write 5 FAQs from its content, save them in a Drive doc and add them to the page.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A dental practice's website has a page for every treatment, and patients keep phoning with the same questions about cost, recovery and how many visits it takes. FAQ sections would help, and the practice manager wants a copy of everything added to the site kept somewhere the dentists can review it.
This automation adds them a batch at a time. Each week it lists the site's pages, skips any already done, AI writes five FAQs from each page's content, a copy is saved as a Google Doc in a shared folder, and the FAQ is added to the end of the page.
What you get out of it
Answers before patients call
Common questions answered on the page mean fewer calls to reception and better-prepared patients.
A reviewable copy of every change
Each FAQ is saved in Drive, where clinicians or managers can read and comment. Anything that needs correcting is easy to spot.
Covers the whole site over time
A weekly batch works through every page without a big one-off project.
Written from your own pages
FAQs are based only on what each page already says, so they stay consistent with your existing information.
How it works
What happens, step by step
Every week, ClickRuntime lists the pages on your WordPress site and skips the ones it has already given an FAQ.
For each page in the batch, AI writes five questions and answers from the page's own content.
A copy of each FAQ is saved as a Google Doc in your Drive folder.
The FAQ section is added to the end of the page, and the page is remembered as done.
Before it runs live
- Connect Google Drive
- 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 Drive and WordPress steps into one automation
Under the hood
The code that runs this automation
import re
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai
FOLDER_ID = "your-drive-folder-id"
SKIP = {"contact", "privacy-policy"}
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):
done = set(state.get("done") or [])
pages = [p for p in wp("GET", "pages", params={"per_page": 100, "context": "edit"}) if p["id"] not in done and p["slug"] not in SKIP][:5]
creds = Credentials(credentials.connection("google", "work"))
docs, drive = build("docs", "v1", credentials=creds, cache_discovery=False), build("drive", "v3", credentials=creds, cache_discovery=False)
for p in pages:
text = re.sub("<[^>]+>", " ", p["content"]["raw"])[:4000]
faq_html = ai.generate(f"Write 5 FAQs answered by this page as HTML (h3 question, p answer):\n{text}", max_output_tokens=900).text
doc_id = docs.documents().create(body={"title": f"FAQ: {p['title']['raw']}"}).execute()["documentId"]
docs.documents().batchUpdate(documentId=doc_id, body={"requests": [{"insertText": {"location": {"index": 1}, "text": re.sub("<[^>]+>", "\n", faq_html)}}]}).execute()
drive.files().update(fileId=doc_id, addParents=FOLDER_ID, fields="id").execute()
wp("POST", f"pages/{p['id']}", json={"content": p["content"]["raw"] + "\n<h2>Frequently asked questions</h2>\n" + faq_html})
done.add(p["id"])
state.set("done", list(done))
return {"pages": len(pages)}FAQ
Common questions
How many pages does it do each week?
Will it change my existing content?
Can I skip certain pages?
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
Write a weekly blog post with its cover image kept in Drive
Each week the next topic on your list becomes a WordPress draft with a cover image, and the image is saved in a Google Drive folder your team can reach.
See how it worksBack up your WordPress posts to Google Drive every week
Every Sunday all your published posts are exported to a CSV file in your Drive backups folder, and you get an email with the link.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksKeep exploring
Set up “Add FAQ sections to your WordPress pages, with copies in Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.