Projects One national site, many state sites, kept in sync automatically
One national site, many state sites, kept in sync automatically
Built a WordPress-to-WordPress sync so updates on the national site reached every state site, without wiping out local edits.

- How long
- 2016
- My role
- DevelopmentSupport
- Kind of project
- IntegrationMedium project
What the business needed.
The agency Follow brought me in to build content sync for the new Variety.org.au website. Variety had one national WordPress site and several state sites, each representing an Australian state. When content changed on the national site, it needed to reach every state site automatically, but state site users also added their own local content that had to stay untouched. State editors could only edit their own local fields, never the national ones. Their original plan was to move data between sites with a scheduled XML export, which risked silently failing or partially importing.
What I did.
I proposed and built a WordPress REST API-based sync instead of the XML approach, since it’s more reliable. I built two custom plugins, one for the national (master) site and one for each state (slave) site. The master site got a “Sync Post” button that pushes only the national content fields to the state sites, leaving each state site’s own locally added content untouched. I also extended the WordPress REST API so post requests returned the post’s metadata in the same call, since the default API doesn’t include it, which kept the number of API calls down. Images still came through WordPress’s separate media endpoint: the state site fetched each image it didn’t already have and registered it in its own media library.
What they got.
A reliable, one-click way to push national content updates to every state site automatically, without a fragile scheduled import and without overwriting what local editors had added.
For your technical person
- Stack: WordPress REST API (WordPress core since 4.7), PHP, custom Advanced Custom Fields (ACF) handling.
- Replaced a planned XML/cron-based content transport with a direct WordPress-to-WordPress REST API sync, for reliability.
- Two custom plugins: one for the national (master) site, one for each state (slave) site.
- Master site “Sync Post” button pushes an API call to state sites with the post ID to update; state sites then pull the full content from the master.
- Field-level merge logic: only national ACF fields are overwritten on sync, local state-site fields are preserved.
- Extended the default WordPress REST API post endpoint to also return post metadata in the same call (by default metadata needs a separate /meta call). Images were fetched with a separate call to the /media endpoint.
- Handled ACF’s per-site reference-key mismatches so custom fields synced correctly without corrupting each site’s own ACF setup.
- Handled WordPress’s attachment-post-type image model on sync: the state site checks for an existing image by name, and if it’s missing, fetches it through the media endpoint, creates the attachment post, saves the file to uploads, and attaches it to the correct post.
- Project size: medium. Delivered 2016.
Related work.
Running into the same problem? Tell me about yours.
+27 87 150 9305Monday to Friday, 09:00 to 20:00 SAST. Or email info@antondevilliers.com.
