Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The translation homepage slug displayed on the sitemap when using RankMath SEO:
https://yoursite.com/en/homepage-slug, it should be https://yoursite.com/en/
Solution:
https://wpml.org/errata/rank-math-seo-incorrect-url-in-sitemap-for-translated-front-page/

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: 

This topic contains 3 replies, has 2 voices.

Last updated by Long Nguyen 1 year ago.

Assisted by: Long Nguyen.

Author Posts
October 30, 2023 at 10:22 am #14689925

martinW-39

In Rankmath Sitemap, we do have instead of yaveon.de/en/ yaveon.de/en/start/ as landingpage.

We looked this issue up already but couldnt fix it either with the SEO Glue Plugin or the changes in function php as mentioned here hidden link

We do run a multisite, which maybe makes the difference here.

Can you pls help

Bildschirmfoto 2023-10-30 um 11.19.05.png
October 31, 2023 at 6:59 am #14696805

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Martin,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

Please follow the workaround below to fix this issue and let me know how it goes:

- Edit the file wp-content/plugins/wp-seo-multilingual/classes/RankMathSEO/Sitemap/Hooks.php

- Around line 58-63, replace the code

$this->secondaryHomesById = Maybe::fromNullable( get_option( 'page_on_front' ) )
			                                 ->map( PostTranslations::get() )
			                                 ->map( Fns::reject( Obj::prop( 'original' ) ) )
			                                 ->map( Fns::map( $getIdAndUrl ) )
			                                 ->map( Lst::fromPairs() )
			                                 ->getOrElse( [] );

with this one

$this->secondaryHomesById = Maybe::fromNullable( get_option( 'page_on_front' ) )
                             ->map( PostTranslations::get() )
                             ->map( Fns::reject( \WPML\FP\Relation::propEq('language_code', apply_filters('wpml_default_language', 'en')) ) )
                             ->map( Fns::map( $getIdAndUrl ) )
                             ->map( Lst::fromPairs() )
                             ->getOrElse( [] );

❌ IMPORTANT: Please backup your database and website before proceeding ❌

Refer documentation https://wpml.org/errata/rank-math-seo-incorrect-url-in-sitemap-for-translated-front-page/

Look forward to your reply.
Thanks

November 2, 2023 at 6:57 am #14712671

martinW-39

It seems like it didnt work. /en/start/ is still in sitemap.
Ive saved permalinks and Sitemap Settings in Rankmath again.

Does it take some time?

Thank you!

Bildschirmfoto 2023-11-02 um 07.55.29.png
November 2, 2023 at 7:47 am #14712997

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

There is a server protection module that prevents accessing your staging site directly so I'm not able to check the sitemap on your staging site. However, I do not see that on your live site.

On the staging site, please try to clear some caches: plugin, browser, hosting ... and disable/enable the sitemap option to see if it works.

If not, I would like to request temporary access (wp-admin and FTP) to your staging site to take a better look at the issue. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

XML-Sitemap - YAVEON 2023-11-02 14-43-37.png
November 10, 2023 at 5:57 am #14772361

martinW-39

Somehow resolved, should work now thanks!