WPML
Status
Resolved
Resolved in
WPML 4.9
Topic tags
Bug

Overview of the issue

When you have a custom product base set to e.g. ”/catalogue/%post_id%/” in Settings > Permalinks in WordPress, and you translate that base, you might encounter an error 404 (Not found) for the translated products

Workaround

Go to: /wp-content/plugins/wpml-string-translation/classes/slug-translation/new-match-finder/wpml-st-slug-new-match-finder.php
There in the function:filter_slug_using_tag, just after this exact code:

	private function filter_slug_using_tag( $slug ) {

add this new code:

		if ( preg_match( '#%post_id%#', $slug ) ) {
			$slug = preg_replace( '#%post_id%#', '([0-9]+)', $slug );
		}

All known issues →