WPML AJAX Call Returns Default Language

Language filtering for AJAX operations

If you are facing “WPML AJAX Call Returns Default Language” problem on your WordPress site then we have the solution for you. This is a common problem with developing multi-language WordPress sites with WPML. If you are logged in then the queries in the same browser will return correct results but if you test your site in a different browser in which you are not logged into wp-admin of your WordPress site then that’s where you will see the results.

Luckily WPML has recognized this major problem and has now added an option in the plugin’s “Languages” page that you can tick to fix this problem. Following are the steps to fix this common problem on your WPML powered WordPress site.

  • Click on the WPML > Languages > Language filtering for AJAX operations
  • Check the “Store a language cookie to support language filtering for AJAX” option
  • Click on the Save button
  • Check your site and the problem should be gone now.

If you do the above and still don’t get the desired results then there is probably something that is interfering with the code and resetting the language in WPML.

, ,