Data Sync from Google Sheets
The plugin provides powerful tools to synchronise your website's route data directly from a master Google Sheet. This is the most efficient way to manage large amounts of data.
This tool is found under Routes → Route Management, in the Route Sync tab.
Route Sync from Google Sheet
This tool allows you to create, update, and delete routes on your website to perfectly match the contents of a Google Sheet.
Core Concept: The Unique ID
The sync process uses the `unique_id` column in your sheet as the primary key. This is the critical link between a row in your spreadsheet and a route post in WordPress. For each row in the sheet, the system looks for a route on your website with a matching `unique_id`.
- If a match is found, the route is updated with the data from that row.
- If no match is found, a new route is created.
- In "Full Sync" mode, any routes on your website whose `unique_id` does not appear in the sheet will be deleted (moved to trash).
Required Sheet Format
Your Google Sheet must be publicly accessible via its CSV export URL and contain columns with the following exact names:
| Column Name | Description |
|---|---|
| unique_id | The unique identifier for the route. Must be a number. |
| route_name | The title of the route. |
| ride_description | A short description, often a list of towns. |
| long_description | The main, detailed description for the route. |
| km / miles | Distance of the route. |
| elevation_m_ / elevation_ft_ | Total ascent of the route. |
| gpx_url | A direct, public URL to the route's GPX file. |
| strava_url | An optional link to a Strava activity. |
| owner | The name of the route creator. |
| g1, g2, g2_5, g3, g4, g5 | Legacy grade columns. Enter 'y' or '+' to assign a grade. |
Using the Sync Tool
- Navigate to Routes → Route Management → Route Sync.
- Choose Sync Mode:
- Full Sync: Creates, updates, and deletes. The recommended mode for keeping the website perfectly in sync.
- Add/Update Only: Use this if you only want to add new routes and update existing ones without deleting any.
- Preview Only: A safe dry-run that shows a report of all changes that would be made, without actually touching your data. Always use this first if you are unsure.
- GPX File Handling: Check the "Download and attach GPX files" box to have the system automatically fetch the GPX file from the `gpx_url` in your sheet and attach it to the route post in WordPress. This is a very powerful time-saver.
- Run Sync: Click the "Run Sync Process" button. A detailed report will be shown upon completion.