Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/wowanium/hreflang-sync-by-sitemaps/releases/download/v1.0.5/hreflang-sync-by-sitemaps.zipWordPress plugin that generates hreflang tags for multi-domain website clusters by syncing URL slugs from XML sitemaps.
What it does
If you manage several country domains or regional sites with the same URL structure, manual hreflang mapping becomes slow and error-prone. This plugin is built for a more practical setup:
- each site uses the same page pattern, such as
/store/{slug}/ - the same slug exists across multiple domains
hreflangtags should only be output when the matching page actually exists on the target domain
The plugin fetches sitemap data, extracts slugs by prefix, stores a cache per domain, and prints valid alternate tags in the page <head>.
Main features
- supports multi-domain
hreflangsetups - parses both
urlsetandsitemapindexXML sitemaps - syncs slugs from each configured domain
- outputs
rel="alternate" hreflang="..."tags only for real matches - supports a custom path prefix such as
/store/,/casino/, or/bookmakers/ - optional
x-defaultoutput - scheduled daily sync via WordPress cron
- manual sync option from the WordPress admin panel
Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher
Installation
- Download or clone this repository.
- Upload the plugin folder to
/wp-content/plugins/. - Activate Hreflang Sync by Sitemaps in WordPress.
- Open Tools → Hreflang Sync.
- Add your domains,
hreflangcodes, and sitemap URLs. - Run the first sync manually.
- Check page source on a matching page and verify the generated
hreflangtags.
Typical use case
Example cluster:
example.de/store/amazon/example.fr/store/amazon/example.co.uk/store/amazon/
If the slug amazon exists on all configured domains, the plugin can output alternate links between them. If one domain does not have that slug, it is skipped.
Important notes
- Use this plugin only when your sites follow a predictable shared URL pattern.
- Do not run another plugin that also outputs
hreflangtags, or you may create duplicates. - This plugin does not create pages. It only maps and outputs alternate URLs for pages that already exist.
- It is designed mainly for multi-domain clusters, not for full single-domain multilingual frameworks.
Admin workflow
After activation:
- go to Tools → Hreflang Sync
- configure the domain list
- set each domain's
hreflangcode - provide the sitemap URL for each site
- define the path prefix used to extract slugs
- run sync and verify the cache
Example scenarios
This plugin is useful for:
- international store directories
- affiliate sites split by country domain
- SEO landing page clusters with the same slug logic
- large site networks where manual reciprocal
hreflangmaintenance is not realistic
Plugin data flow
- Fetch XML sitemap from each configured site.
- Parse nested sitemaps when needed.
- Extract URLs matching the configured path prefix.
- Convert matching URLs into slugs.
- Store the slug map in WordPress options.
- On page load, match the current slug against the cache.
- Output only the valid
hreflanglinks.
Development notes
Current plugin header values:
- Plugin Name:
Hreflang Sync by Sitemaps - Text Domain:
hreflang-sync-by-sitemaps - Requires at least:
5.8 - Requires PHP:
7.4 - License:
GPLv2 or later
License
This project is licensed under the GNU General Public License v2.0 or later. See the LICENSE file for details.
Releases
1 release. Each count is every asset in that release; expand a row for the breakdown.