Title: Incompatible with WMPL
Last modified: April 24, 2018

---

# Incompatible with WMPL

 *  Resolved [cweblator](https://wordpress.org/support/users/cweblator/)
 * (@cweblator)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/incompatible-with-wmpl/)
 * We are using Contact form 7 with a site that implements WPML for language translation.
   It is using the mode where it appends ?lang=xx to the query string.
 * This presents an issue, as wpcf7.apiSettings.getRoute generates a url with the
   query string in the middle of the url, creating an invalid submission url: e.
   g. [https://www.domain.com/wp-json?lang=xx/contact-form-7/v1/contact-forms/8663/feedback](https://www.domain.com/wp-json?lang=xx/contact-form-7/v1/contact-forms/8663/feedback)
 * I have replaced the function with the following to resolve it:
 *     ```
       wpcf7.apiSettings.getRoute = function( path ) {
       		var url = wpcf7.apiSettings.root;
   
       		url = url.replace(
       			wpcf7.apiSettings.namespace,
       			wpcf7.apiSettings.namespace + path );
   
               var qs_index = url.indexOf('?');
               if(qs_index > 0)
               {
                   var replace = url.substring(qs_index, (qs_index + 9));
                   url = url.replace(replace, '');
               }
   
       		return url;
       	};
       ```
   
 * Obviously this gets overridden whenever we have to update the plugin, so I would
   appreciate a permanent fix being implemented in the code.
 * Kind regards
    Chris

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/incompatible-with-wmpl/#post-10215749)
 * > This presents an issue, as wpcf7.apiSettings.getRoute generates a url with 
   > the query string in the middle of the url, creating an invalid submission url:
   > e.g. [https://www.domain.com/wp-json?lang=xx/contact-form-7/v1/contact-forms/8663/feedback](https://www.domain.com/wp-json?lang=xx/contact-form-7/v1/contact-forms/8663/feedback)
 * Yes, the URL is invalid and only seen when the WPML is active.
 * Since [this support forum is not for commercial plugins](https://make.wordpress.org/support/handbook/forum-welcome/#do-not-post-about-commercial-products),
   instead of here, please contact the vendor’s support and tell them it is causing
   a severe problem.
 *  [Phil](https://wordpress.org/support/users/magicfilou/)
 * (@magicfilou)
 * [8 years ago](https://wordpress.org/support/topic/incompatible-with-wmpl/#post-10266557)
 * Use wpml with language in directory (or subdomain) instead of parameter ?lang
   =XX and it will work like a charm

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Incompatible with WMPL’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Phil](https://wordpress.org/support/users/magicfilou/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/incompatible-with-wmpl/#post-10266557)
 * Status: resolved