Skip Navigation

Open

Reported for: WPML SEO 2.0.1

Topic Tags: Multilingual SEO

Overview of the issue

In some specific cases, the Yoast breadcrumb category may link to the wrong language. For example, if you enable the Directory for default language option in WPMLLanguagesLanguage URL format and you use a permalink structure like /%category%/%postname%/.

Workaround

Please make a full backup of your site before proceeding.

  1. Open the wp-content/plugins/wp-seo-multilingualclasses/Presentation/Hooks.php file
  2. Replace the following snippet:
    private static function getTermLink( $term, $fallback ) {
    		return Maybe::fromNullable( get_term_link( $term ) )
    		     ->filter( pipe( Logic::not(), 'is_wp_error' ) )
    		     ->getOrElse( $fallback );
    }
    

    With this:

    private static function getTermLink( $term, $fallback ) {
    		return Maybe::fromNullable( get_term_link( $term ) )
    		     ->filter( pipe( 'is_wp_error', Logic::not() ) )
    		     ->getOrElse( $fallback );
    }
    

2 Responses to “Yoast SEO - On breadcrumb, post category links to the wrong language”

    • Hey there,
      We don’t have an ETA yet, however we will update it here once we have any news.
      Thank you for your understanding.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>