Reported for: WPML Multilingual CMS 3.2.2

Resolved in: 3.2.3


When the “Language name added as a parameter” option is chosen, the pagination URL is broken in the secondary languages.


Add the following code to your theme’s functions.php file:

add_filter( 'get_pagenum_link', 'wpml_workaround_get_pagenum_link' );
function wpml_workaround_get_pagenum_link( $url ) {
$current_language = apply_filters( 'wpml_current_language', '' ); 
$pattern = '/(\?lang=' . $current_language . ')(\/.*)/'; 
$url = preg_replace( $pattern, '$2', $url ); 
return $url;

The issue has been resolved in the upcoming new version.

2 Responses to “Pagination URL is broken with “Language name added as a parameter” enabled”

  1. I am getting a different result. I can only use the LANGUAGE NAME ADDED AS A PARAMETER”, I would like to use the “DIFFERENT LANGUAGE DIRECTORY”.