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: Bug
This topic contains 2 replies, has 0 voices.
Last updated by anna-stanczykT 2 days, 17 hours ago.
Assisted by: Bruno Kos.
Author | Posts |
---|---|
July 7, 2025 at 7:35 am #17206570 | |
anna-stanczykT |
Background of the issue: Symptoms: Questions: |
July 7, 2025 at 3:15 pm #17209843 | |
Bruno Kos WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+02:00) |
This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you. |
July 8, 2025 at 12:51 pm #17213955 | |
Bruno Kos WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+02:00) |
As a temporary workaround, you can make a direct modification to the plugin's codebase. Please follow these steps carefully: 1. Open the following file in your plugin directory: /plugins/wp-seo-multilingual/classes/Shared/Sitemap/BaseAlternateLangHooks.php 2. Locate the `addAlternateLangData` function, which starts around line 59. 3. Immediately after this line: list( $elements, $getPermalink, $isIndexable ) = $this->getEntryHelpers( $type, $obj ); 4. Insert the following block of code: // Exclude hidden language posts global $sitepress; $hidden_languages = $sitepress->get_setting( 'hidden_languages', [] ); if ( $elements && !empty($hidden_languages) ) { foreach ( $elements as $lang => $element ) { if ( in_array( $lang, $hidden_languages ) ) { unset( $elements[$lang] ); } } } This change will ensure that any posts in hidden languages are excluded from the alternate language data in your sitemap. The permanent fix will likely end up in the next version of our WPML SEO plugin. |
July 9, 2025 at 6:15 am #17216857 | |
anna-stanczykT |
Thank you. It helped. |