Skip Navigation


Resolved in: 4.0.0

Overview of the issue

Before 4.0.0, WPML attempted to have the trailing slash match the incoming URL during the conversion. Unfortunately, this logic is not adapted for all cases.

Starting from 4.0.0, the converted URL will match the standard WordPress behavior which is as follow:

  • When there’s no path and no query, WPML will try to match the incoming URL (e.g. =>, or => However, WordPress usually outputs the home URL without any trailing slash.
  • When there’s no path but there’s a query, we will always have a trailing slash (e.g. =>
  • When we have a path (not a file), the trailing slash depends on the permalink format.
  • When we have a path pointing to a file, no trailing slash should be added (regardless of the permalink format). Example:


This change can have some unexpected side effects in themes or 3rd part plugins.

We strongly advise avoiding string concatenation to build URLs and make use of functions like:


For example, the following code:

$url = get_home_url() . '/' . $path;

Should be replaced by:

$url = trailingslashit( get_home_url() ) . $path;