Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/akamust/cross-site-hreflang-switcher/archive/refs/heads/main.zipCross-site Hreflang Switcher WordPress Plugin
Description
The Cross-site Hreflang Switcher is a WordPress plugin designed to solve a unique challenge in SEO for international websites: implementing hreflang tags between two separate WordPress installations on different domains that share the same URL structure.
There are many plugins that handle hreflang tags for multisite installations or for a single WordPress site with multiple languages. However, there was no solution available for two entirely separate WordPress sites. This plugin fills that gap.
If you have, for example:
www.example.co.ukwww.example.com.au
And both sites have the same page/post structure (e.g., .../my-awesome-post/), this plugin will automatically add the correct hreflang meta tags to the <head> section of your pages to tell search engines about the relationship between them. This helps prevent duplicate content issues and ensures the correct version of a page is shown in search results for a specific country.
Installation
- Download the plugin as a ZIP file.
- In your WordPress admin panel, go to Plugins > Add New.
- Click Upload Plugin and select the ZIP file you downloaded.
- Activate the plugin.
- Go to Settings > Cross-site Hreflang to configure the plugin.
How it works
The plugin adds a simple settings page where you can define the language and URL for each of your sites. Once configured, it will automatically generate the appropriate <link rel="alternate" hreflang="..." href="..."> tags on every page.
License
This plugin is licensed under the GPLv2 or later. See the LICENSE file for more details.