탐색 건너뛰기

Open

Reported for: WPML SEO 2.1.0

Topic Tags: Compatibility

Overview of the issue

If your create your homepage in a different language than the site’s default language, you will notice that Rank Math SEO plugin sitemap incorrectly displays the actual slug of the page instead of just the language directory.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-seo-multilingual/classes/RankMathSEO/Sitemap/Hooks.php file.
  • Look for line 58.
  • Change:
    			$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( [] );
    
  • For
    			$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( [] );
    

7 응답 에게 “Rank Math SEO - Incorrect URL in Sitemap for Translated Front Page”

  1. I am not too deep in coding and in SEO so please don’t judge. I am just installing WPML and learning about it. Do I need to impelement upper written instructions to mysite? Or it is already fixed in the WPML plugin after my recent instalation?

    • Hello there,
      This issue is still visible with our last version of WPML SEO add-on. If you are experiencing it on your website, please follow the workaround here provided.
      Otherwise, you can also contact our support, we will be able to help you implementing this fix.
      Regards

    • Hello there,
      Yes, it is correct. Many of the current open issues will be fixed in the next WPML SEO version release. However, a few of them may need to wait for an upcoming version.

    • Hello there,
      Have you tried replacing the “en” for “nl” in this line?
      apply_filters(‘wpml_default_language’, ‘en’)
      Let me know if it works.

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>