Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Marsel Nikolli 1 year, 9 months ago.

Assisted by: Marsel Nikolli.

Author Posts
September 27, 2023 at 9:41 am #14472329

almazK

Hello, such a question about hreflang
My default home page is English
But when I create an article or page without English, I can't find x-default
Is this normal? how does this affect SEO
How to correctly write x-default and hreflang

September 28, 2023 at 10:05 am #14480349

Marsel Nikolli

Hi there,

Thank you for contacting WPML Support.

I could see that you are using the Yoast Seo plugin, you also need the WPML SEO add-on if you haven't already installed/activated it.
WPML SEO makes your multilingual site compatible with popular SEO plugins Yoast SEO.

If you already have WPML SEO installed/activated please note that:

If a post/page is missing the default language the x-default will be missing as well.

The expected procedure is to create the posts/pages in the default language and translate from there.

- The x-default will always be assigned to the default language
- The x-default will not be assigned when a language is stand-alone meaning that it's missing a translation, even if that language was created in the secondary language first.

While I did not work on this issue here https://wpml.org/forums/topic/hreflang-x-default-is-missing-from-some-pages-2/#post-11625629, is a workaround for which it's important to note that we do not consider workarounds as official solutions and are suggestions that we do not upkeep or maintain with recent updates.

You can simply add the code shared to your theme's functions.php and it will pull the page's language code and assign it as an x-default.

**NOTE: Always have a recent and working backup before making any changes recommended by our team or a 3rd party
**

Let me know if this works out for you.

Regards,
Marsel