“One Site To Rule Them All”, syncing problems between WordPress websites

[ad_1]

I have a WordPress site where I manage all my posts, and I need a reliable way to sync selected posts to several other WordPress sites.

Currently, I’m using a taxonomy called “sites”, where each term is a site’s URL. When a post is saved, I trigger REST API calls for each selected term to send the post to the corresponding sites. This method works for new posts but isn’t efficient for bulk synchronization.

For instance, when launching a new site and needing to sync most posts to it, I have to add the new term to each post and trigger the `save_post` hook, which takes a long time. Additionally, every time I save a post, the script updates that post on all linked sites, not just one.

I’m looking for better ways to manage this “one site to rule them all” setup and streamline the synchronization process.

[ad_2]
4 Comments
  1. Is this in multi site setup or you trying to send to sites of different hosts.

  2. * Do sync asynchronously as a background scheduled process, not in your main save_post hooks etc.
    * Batch calls, don’t do post by post if you’re going to send them to the same destination anyway.
    * Use different DB read tables per website, e.g. views partitioned on a particular set of keys that manage which posts should be included/excluded, so no cross-server synchronization is needed at all.

    Lots of ways to handle and scale synchronization if you have the experience for it.

  3. Consider using a dedicated plugin like WP Remote or WP Multisite for efficient bulk synchronization and selective updates, improving speed and management of your WordPress network.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer