WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.5.10
Resolved in
WPML 4.6.4
Related plugin/theme
Elementor

Overview of the issue

If you are using a /%category%/%postname%/ permalink structure, when you visit the last post published, the WPML language switcher will point to the wrong URL.

For example, instead of pointing to:

https://domain.com/nl/news-nl/hello-world-nl/

It will direct you to:

https://domain.com/nl/news-en/hello-world-nl/

Workaround

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

  1. Open your theme’s functions.php file.
  2. Add the following snippet:
     add_filter('template_include', function($t){ wp_cache_flush(); return $t; }, 999); 

All known issues →