We use WPML for two different languages and different domain names. The issue is that in the, not main, language version of the site the hreflang's are incorrect.
Looking at the source of "view-source:hidden link", the conical links are perfect:
The nl-be version is pointing the the correct URL on staging2.boekdrukken.be. Looking at the page on boekdrukken.be though the links to the nl-nl are incorrect, it seems like the domain name of the nl-nl site is not used:
We've already cleared/disabled caching and this gave no resolution to the problem. Could you please assist fixing this issue?
Before this is taken by a colleague, let me share some thoughts after reading the advice given to you by Maiya.
Maiya correctly identified that the problem likely relates to your settings in wp-config.php for the WP_HOME and WP_SITEURL constants, but looks to have misidentified whether you were using a WordPress multisite installation or not.
Let me clarify.
According to what I read, you are using a single site which is set to use different domains per language.
I'm not sure which is your default site and which the secondary language site.
Let's assume that the .nl site is your default, and the .be site is the secondary language.
In which case the .nl url is the "real" site, and the .be url is a virtual url that points to the .nl server, where the WordPress files and database actually reside.
So, there is only one wp-config.php file.
For WPML to work correctly, if you want to define the WP_HOME and WP_SITEURL constants, they should be defined with static values (not with a variable like $_SERVER['HTTP_HOST']).
And the static value should always point to the default language site url (which I have assumed to be the .nl url), e.g.
I suspect you had defined them to use $_SERVER['HTTP_HOST'] because your workflow means that you have the same wp-config.php file on staging and on production.
In that case you would need to conditionally set the constants depending on whether you were in the staging environment or production environment. Sometimes people define this with a constant within the config file so that it needs changing in only one place. Another option could be to check whether whether the current url is a staging environment or not, and set the constants accordingly (always to static strings themselves), e.g.
We are using a multisite installation indeed. At this stage we're building and testing the staging-version(s) only. I've changed the wp-config.php to have the following code to make sure the site correctly identifies the domain:
Our primary version of the site is staging2.probook.nl and secondairy version is staging2.boekdrukken.be. I've checked the WP_HOME and WP_SITEURL after the change above and I do get the right values:
[12-Mar-2026 13:49:21 UTC] WP_HOME: hidden link
[12-Mar-2026 13:49:21 UTC] WP_SITEURL: hidden link
I'm affraid this did not solve the issue, I still get this on staging2.boekdrukken.be:
<link rel="alternate" hreflang="nl-be" href="hidden link" />
<link rel="alternate" hreflang="nl-nl" href="hidden link" />
<link rel="alternate" hreflang="x-default" href="hidden link" />
To debug this issue further, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.
So could you please provide me with those details, you will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link