A-2 Aishwarya Appt. Satellite Ahmedabad
+91 9825751564

WPML Plugin Shows 404 error with WordPress version Upgrade

If you are truly looking forward to developing and running a multilingual website, you must go ahead with one ofā€¦

If you are truly looking forward to developing and running a multilingual website, you must go ahead with one of the best WordPress plugin called WPML.
It allows you to build phenomenal WordPress websites which can support multiple languages, and that takes your business a step further when it comes to gaining popularity among a wide range of people across the world.
However, the one thing that creates a slight discomfort to users is that whenever they update WordPress version, the old version of WPML started showing 404 errors in Admin when you save menu of WordPress in secondary language.

How to solved 404 errors with old version WPML (, when we update WordPress Version:

Can you update the old version of WPML with latest WPML version to fix this problem
You need to do some coding level changes, if donā€™t want to upgrade to the new version:

Follow given steps to solve 404 errors inĀ secondĀ language, with WPML Old Version

Download the updated version ofĀ Ā iclNavMenu.class.php
You need to replace in WPML plugin, You can find at below path. ā€œsitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.phpā€.
If you have FTP clients, then upload the file at below path.
ā€sitepress-multilingual-cms/inc/wp-nav-menusā€ : If youā€™re asked to overwrite the existing file, just do it.

In case you get any of these issues:

PHP Fatal error: Call to undefined function wpml_prepare_in() in /wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/iclNavMenu.class.php on line 548

If anyone is using a very old version of WPML Plugin, sometime you havenā€™t found wpml_prepare_in() function in functions.php file of the plugin.

ā€œIn these cases, you may get a blankĀ page,Ā or these errors: PHP Fatal error:Ā  Call to undefined function wpml_prepare_in()ā€

Follow below steps to add some code in that file and then our issue will be resolved.

Search for: ā€œwpml_prepare_inā€
If you canā€™t find it, add below code to bottom of the file:

function wpml_prepare_in( $items, $format = ‘%s’ ) {
global $wpdb;
$itemsĀ Ā Ā  = (array) $items;
$how_many = count( $items );
if ( $how_many > 0 ) {
$placeholdersĀ Ā Ā  = array_fill( 0, $how_many, $format );
$prepared_format = implode( “,”, $placeholders );
$prepared_inĀ Ā Ā Ā  = $wpdb->prepare( $prepared_format, $items );
} else {
$prepared_in = “”;
return $prepared_in;