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.
Tagged: Exception
This topic contains 11 replies, has 2 voices.
Last updated by stephenG-6 1 year, 11 months ago.
Assisted by: Prosenjit Barman.
Author | Posts |
---|---|
May 10, 2023 at 3:04 pm #13624141 | |
stephenG-6 |
We are having technical issues where the HTML Lang of the pages does not match HREF Lang. This is a development site of Issue that we are facing See detailed explanation of issues on the site |
May 11, 2023 at 12:52 pm #13630481 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I have checked the videos you've shared and completely understood that issue. Both HTML and hreflang tags are intended to optimize content in multiple languages. But they have a couple of differences. The hreflang attribute is used to indicate which language versions of a page exist and which version should be displayed to users, while the HTML lang attribute is used to specify the language of the content within a document so that the browser can understand and render accordingly. Now, in order to solve the mismatch issue, the "default locale" and "hreflang" need to be the same inside the WPML language configuration. Please navigate to "WPML > Languages > Edit languages" and make sure that the value for "hreflang" and "default locale" is the same for the languages. However, it is not recommended to change the default locale of a language, as the browser relies on it. Instead, you can set the `hreflang` attribute value to the same language code as the default locale. I hope it will help. Let me know if that helps or if you need any further assistance. I will be happy to assist you. Best Regards, |
May 11, 2023 at 4:28 pm #13632073 | |
stephenG-6 |
Hi Prosenjit, Thank you for your attention to this issue. We appreciate the guidance, and we have further questions: 1) In the video below, you will see why the questions b) why do we have a line code under the other languages like x-default? <link rel="alternate" hreflang="x-default" href="hidden link" /> See the video below for more details on the questions. hidden link I really appreciate any help you can provide. |
May 12, 2023 at 11:21 am #13636551 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, The video that you shared does not have any voiceover. Therefore, I was unable to understand if you had added any questions or comments to the video. But, I clearly understood the questions you mentioned in your last response. Please find the answers below. a) You've got it right! The value for Default Locale and Hreflang needs to be the same. For example, if the default locale for English is set as "en_US", then the hreflang should also be "en_US". Please adjust the value accordingly for each language and check if that helped. As it is related to SEO, it is also advisable to discuss with an SEO expert regarding the recommended hreflang format. I hope you can understand. b) "x-default" as hreflang attribute value indicates that the linked page doesn't target any specific language or locale and is the default or fallback page. You can check the links below to get a better understanding. - hidden link Please let me know if you need further assistance in this matter. I will be happy to help you. Best Regards, |
May 12, 2023 at 11:51 am #13637061 | |
stephenG-6 |
Prosenjit Thank you for the information sent today. It is clear. Three more questions 1) Can I change the Locale of the languages and hreflang without affecting the site? I understand that affects SEO. Do you recommend any reference to guide me on this? Thank You! 2) Language mapping is only used for automatic translation, correct? We are not using automatic translation but would like to choose a language. Is that OK? 3) We are not passing stange characters to the URL. So we are ok leaving No for encoded URL, correct? Thank you! Thank you! |
May 12, 2023 at 12:03 pm #13637101 | |
stephenG-6 |
Also, all this craziness with the keys has me confused. If I use a development site that has a key and I copy it to live It is asking If it is a copy or the site has moved which one should I choose Please Thanks |
May 15, 2023 at 7:40 am #13645117 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I'm happy to hear that my previous response was clear and understandable to you. Please find the answer to your other questions below. 1) Your default locale is what lets WordPress and other plugins know which .mo files to use. Default locales are set by WordPress and those should not be changed as it may affect your site. Please check this link(https://make.wordpress.org/polyglots/teams/) for a better understanding. But, if you want, you can change the Hreflang of your site which is safe. You can check the guide below to know more about the Hreflang on multilingual sites. Hope it will help. - https://wpml.org/documentation/support/adding-hreflang-wordpress/ 2) The Language Mapping functionality is for Automatic Translation and checks the spelling. If you are not using Automatic Translation, you can still set a language. That will not cause any problems. 3) If your language uses Latin script and ASCII characters, you do not have to encode your URLs. You can check the link below to get a better understanding of when to encode URLs and when not. In response to what to select from the Site Migration banner- The site migration banner will only appear after copying or migrating a site. In order to understand what to do when this banner appear, kindly check the documentation below where everything is described in detail. I hope it will help you most. Please let me know if there is anything else if you need help with. I will be happy to assist you. Best Regards, |
May 15, 2023 at 8:28 pm #13651239 | |
stephenG-6 |
Prosenjit Thank you so much great guidance and support 1) We changed for English the HREFlang for one of the issues got resolved for English. But we have an issue with the Spanish language. Our default local is for Spain Es _es and our ahreflang is ES as in the link below. We want to change it to generic ES is that possible? since we what it to be used with all the Spanish-speaking countries |
May 16, 2023 at 1:23 pm #13656785 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, Glad to hear that issue with English is resolved. In response to changing the locale for Spanish language- It is not recommended at all to change the default locale as it is pre-defined by WordPress. If you change the locale, then the translations existing in ..wp-content/languages/... may not be found. WordPress, plugin authors, and theme authors all use locales to match .mo/.po and JSON translations. If you want to add your own locale, then you may consider changing the language file names to reflect that otherwise, you will have to retranslate your entire environment. If you want, you can create a custom language by adding the locale and hreflang as per your needs. Please check the documentation below to understand the process. - https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/ I hope you can understand the difficulties that may create by changing the locale. But, feel free to tweak the Hreflang as per your needs. Let me know if you need any further assistance. Best Regards, |
May 18, 2023 at 3:55 pm #13673545 | |
stephenG-6 |
Hi There, Thank you for the guidance. I changed the locale on the ES staging site, and I see nothing broken. Can you guide me on what I need to be aware of, just in case? We use human translation, so I am hoping the impact I less..thanks for the outstanding support |
May 19, 2023 at 12:22 pm #13679147 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi There, The plugin and theme developers include multilingual support in their products based on the default locale code defined by WordPress(https://make.wordpress.org/polyglots/teams/). Now, WPML also relies on the Locale code. If there is a mismatch between the codes defined in the WPML configuration and the language file of the Theme or plugin, then WPML will not be able to identify the corresponding language file and proceed with the translation process. You may encounter issues primarily with applications or systems that depend on the default locale. But, as you'll be manually translating everything, I hope you'll not face any issues. Please feel free to let me know if there's anything else I can assist you with. I'll be glad to assist you further. Best Regards, |