Weekly
Back 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.
- Runs
- Weekly
- Apps
- Google Drive, WordPress
- AI
- Not needed
- Access
- WordPress read; Drive write
Send this to your assistant
Create a ClickRuntime automation: every Sunday, export all my WordPress posts with title, URL, date and content to a CSV in my Drive backups folder and email me the link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small publisher has years of articles on a WordPress site maintained by a freelance developer. Hosting backups exist somewhere, but nobody on the team knows how to restore them, and a broken plugin update or a hacked account could wipe out content they cannot recreate.
This automation gives them a copy they control. Every Sunday it pages through all published posts, writes the title, link, date and content into a CSV file, saves it in a Google Drive backups folder and emails the link. If anything goes wrong, the words are safe and readable in a spreadsheet.
What you get out of it
A copy you can open yourself
The backup is a CSV in your own Drive, readable in Google Sheets or Excel. You do not need a developer to get your content back.
Independent of your host
If the hosting company, a plugin or a login fails, your posts still exist elsewhere.
Weekly, without remembering
The export runs every Sunday on its own. New posts are always in next week's file.
Proof the backup worked
The email with the link confirms each backup and tells you how many posts it contains.
How it works
What happens, step by step
Every Sunday, ClickRuntime pages through all published posts on your WordPress site.
It writes each post's title, link, date and content into a CSV file named with today's date.
The file is saved in your Google Drive backups folder.
You get an email with the link and the number of posts in the backup.
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
- Add an AI step, for example to summarize, sort or draft a reply
- 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 csv, io
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, http, notify
FOLDER_ID = "your-drive-folder-id"
WP = "https://blog.example.com/wp-json/wp/v2/posts"
@on_trigger
def run(event):
out, rows, page = io.StringIO(), 0, 1
writer = csv.writer(out)
writer.writerow(["title", "url", "date", "content"])
while True:
r = http.get(WP, params={"per_page": 100, "page": page, "status": "publish", "_fields": "title,link,date,content"})
if r.status_code == 400 or not r.json():
break
for p in r.json():
writer.writerow([p["title"]["rendered"], p["link"], p["date"], p["content"]["rendered"]])
rows += 1
page += 1
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
f = drive.files().create(body={"name": f"wordpress-posts-{date.today()}.csv", "parents": [FOLDER_ID]},
media_body=MediaIoBaseUpload(io.BytesIO(out.getvalue().encode()), mimetype="text/csv"), fields="webViewLink").execute()
notify.email_me(f"WordPress backup: {rows} posts", f["webViewLink"])
return {"posts": rows}FAQ
Common questions
Does it include images?
Can I restore posts from the CSV?
How many backups are kept?
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 worksAdd 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.
See how it worksKnow the moment your website goes down
Your team hears in Slack when the site stops responding or slows down, and again when it's back.
See how it worksKeep exploring
Set up “Back up your WordPress posts to Google Drive every week” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.