Setting Up Hreflang Synchronization Across Multiple Sites
The sync feature helps speed up the configuration of hreflang data, eliminate repetitive manual work, and ensures consistent and accurate hreflang data across all sites.
When the sync feature is enabled, you configure the hreflang data only on one site (the Controller) while all remaining sites (the Responders) automatically inherit and stay updated with the controller’s data. If a page is added, removed, or its permalink changes, the plugin keeps all responder sites synchronized accordingly.
The sync system works in any environment: sites installed in subfolders, subdomains, completely different domains, standalone WordPress installations, or multisite networks. In short, the sync feature is compatible with virtually any scenario.
Let’s go through how the sync system works and how to configure it properly on your sites.
The Role of Controller and Responder
A sync setup typically consists of:
- One Controller site – the place where you manually configure all hreflang connections.
- One or more Responder sites – sites that receive and inherit all hreflang data from the controller.
If all sites will share the same hreflang structure, you can select any site as the controller. If you plan to manually configure additional connections on certain responder sites, choose the controller based on the site that contains the most complete set of hreflang connections.
Configure a Controller Site
Once you finish configuring the hreflang data on the controller, manually, by bulk import, or by importing XML files, you can activate the sync feature so responder sites can inherit these data automatically.
To configure a site as a Controller:
- Visit Hreflang → Options → Hreflang Sync.
- Set Status to Enabled.
- Set Role to Controller.
Configure a Responder Site
After the controller site is ready, configure each Responder site:
- Visit the Hreflang Sync tab available in the Hreflang -> Options menu.
- Set the Status option to “Enabled”.
- Set the Role option to “Responder”.
- Set the frequency of the updates with the Frequency option. The plugin uses WP Cron to schedule the sync activity based on the defined frequency. The following frequency values are available: Hourly, Twice Daily, Daily, Weekly.
- Enter the REST API endpoint generated by the controller website in the Controller Endpoint option. This value should be equal to the URL of the controller website plus the suffix “/wp-json/daext-hreflang-manager/v1/sync”. For example, if the controller website is “https://example.com” the value of this option should be “https://example.com/wp-json/daext-hreflang-manager/v1/sync”.
- Set the Sync Mode option to “Based on Sync Options”. Note that by leaving the value of this option to “Exact Copy” the plugin makes an exact copy of the connections without adapting the Url to Connect value.
- Set the Language, Script, and Locale used in this website. The plugin uses this information to set the URL to Connect value of each connection imported from the controller website. It’s important o highlighted the fact that if this value is not set correctly the URL to Connect value of the responder site will not match the correct one and this will result in hreflang tags not added to the pages or incorrect data in case the XML Sitemap implementation is used.
Configuring a Sync Frequency
The Frequency option determines the frequency of the procedure used to sync the data. For example, if the sync frequency is set to “Hourly,” the responder site will attempt to sync once every hour.
If on the responder site new URLs do not appear immediately after configuring the sync options, this is normal. They will be visible after the next scheduled cron run based on your selected frequency. After saving the sync options, the first run will usually occur within the next minute.
We recommend checking checking a successful sync process by visiting the Connections menu after completing the sync configuration of the responder site. If the hreflang data are not there just after the configuration, wait a few seconds and refresh the Connections page, this will trigger pending WP Cron and likely run the one used by Hreflang Manager.
In addition, remember that WP-Cron depends on site activity, so it may not run at precise intervals like a system-level cron job.
Troubleshooting
Make Sure the Controller Site Data Are Available at the Rest API Endpoint
The controller’s data must be visible at (replace http://example.com with the controller site domain):
https://example.com/wp-json/daext-hreflang-manager/v1/sync
Open this URL in your browser and verify that it returns JSON data containing your connections.
URLs Don’t Appear Instantly in Responder Sites
If new URLs do not appear immediately on the responder site, this is normal. They will be visible after the next scheduled cron run based on your selected frequency.
However, if for any reason you want to monitor the status of the WP Cron task used to perform the repeated sync process in a responder site, or even trigger these task manually you can proceed like this:
- Install WP Crontrol.
- Open the Cron Events tab.
- Find the hook
da_hm_cron_hook. - Click Run Now to synchronize immediately.
Make Sure the Responder’s Language, Script, and Locale Are Set Correctly
As described earlier, the plugin uses these three values to reshape the “URL to Connect” for each imported connection. If they are incorrect:
- Hreflang tags may not appear in the pages.
- XML Sitemap hreflang data may also be incorrect.
If needed, correct these values in the responder site options, click Save settings, and wait for the next sync (or trigger one manually using WP Crontrol).
Addition Recommended Checks
- Each page on the controller site should have only one connection.
- In most cases hreflang tags should be added only on the controller site.
- Ensure the Language, Script, and Locale of each responder exactly match the values used in Hreflang → Connections.
Creating Hreflang Connections Detached From the Sync in Responder Sites
The plugin allows you to create additional connections directly in a responder site that remain independent from the connections inherited during the sync process. These manually created connections are not modified or deleted during synchronization, and they do not affect the controller site.
A common scenario where this is useful is when two alternate pages exist only across responder sites, but not on the controller site. In such cases, you may need hreflang links between responder-site pages that the controller cannot provide.
To create this type of independent connection and ensure it is preserved during sync operations, proceed as follows:
- Access one of the responder sites.
- Navigate to the Hreflang Sync tab in the plugin options.
- Set Delete Target to Inherited. (this option determines which connections may be removed during synchronization. All → any connection can be deleted during sync. Inherited → only connections imported from the controller may be deleted. This protects manually created connections from being removed.)
- Click Save settings.
- Visit the Connections menu.
- Create the new connections. These connections will have the Inherited value in the Advanced tab set to “No”, allowing the plugin to distinguish them from connections inherited from the controller.