Allowing Caching for WPML and WCML on Pressable

Last modified: November 10, 2025

If you’re using the WooCommerce Multilingual & Multicurrency (WCML) plugin with the WPML plugin on Pressable, you might experience caching issues due to specific cookies that interfere with Batcache and Edge Cache.

These cookies include the following:

  • wcml_client_currency
  • wcml_client_currency_language
  • wcml_client_country
  • wp-wpml_current_language

The cookies are set to manage currency and language preferences but can prevent caching, causing potential performance issues on your Pressable site.

To address this, you can customize Batcache to recognize these cookies, ensuring that caching functionality is restored while maintaining the necessary multilingual and multi-currency features on your Pressable site.

Please follow all the steps below to address the issue.

Disable Language Filtering for AJAX Operation

The wp-wpml_current_language cookie is set when the “Language filtering for AJAX operations” feature is enabled in WPML, can interfere with Edge Cache. To prevent this, consider disabling this feature:

Disable wp-wpml_current_language cookie from interfering with batcache.
Language filtering for AJAX operations option on WPML Settings
  • In your WordPress dashboard, go to WPML → Languages.
  • Scroll to the “Language filtering for AJAX operations” section.
  • Uncheck the option labeled “Store a language cookie to support language filtering for AJAX“.

Disabling this setting will prevent WPML from setting the wp-wpml_current_language cookie, allowing the Edge cache to hit. Then Implement Batcache Customizations using the steps below.

Cache Customization Options

There are two options—you can use either one depending on your preference when implementing Batcache customization for WPML cookies:

Option 1: Batcache customization for WPML – Directly Modify wp-config.php

Directly Modify wp-config.php

  • Use SFTP or SSH to connect to your site’s files
  • Locate the wp-config.php file in your site’s root /htdocs directory
  • Place the code snippet below immediately above the line:
  • /* That's all, stop editing! Happy blogging. */
//Batcache Customizations
global $batcache;

//Check if batcache params are in an object or an array, apply customizations accordingly
if ( is_object( $batcache ) ) {

    // Merge WCML/WPML cookie names with existing noskip_cookies, or set them if not defined.
    $new_noskip = array(
        'wcml_client_currency',
        'wcml_client_currency_language',
        'wcml_client_country',
        'wp-wpml_current_language'
    );
    if ( !isset($batcache->noskip_cookies) || !is_array($batcache->noskip_cookies) ) {
        $batcache->noskip_cookies = $new_noskip;
    } else {
        $batcache->noskip_cookies = array_unique(array_merge($batcache->noskip_cookies, $new_noskip));
    }

    // Merge WCML/WPML cookie values into the unique cache key components.
    if ( !isset($batcache->unique) || !is_array($batcache->unique) ) {
        $batcache->unique = array();
    }
    $batcache->unique['wcml_client_currency'] = isset($_COOKIE['wcml_client_currency']) ? $_COOKIE['wcml_client_currency'] : '';
    $batcache->unique['wcml_client_currency_language'] = isset($_COOKIE['wcml_client_currency_language']) ? $_COOKIE['wcml_client_currency_language'] : '';
    $batcache->unique['wcml_client_country'] = isset($_COOKIE['wcml_client_country']) ? $_COOKIE['wcml_client_country'] : '';
    $batcache->unique['wp-wpml_current_language'] = isset($_COOKIE['wp-wpml_current_language']) ? $_COOKIE['wp-wpml_current_language'] : '';

} elseif ( is_array( $batcache ) ) {

    // Merge WCML/WPML cookie names with existing noskip_cookies, or set them if not defined.
    $new_noskip = array(
        'wcml_client_currency',
        'wcml_client_currency_language',
        'wcml_client_country',
        'wp-wpml_current_language'
    );
    if ( !isset($batcache['noskip_cookies']) || !is_array($batcache['noskip_cookies']) ) {
        $batcache['noskip_cookies'] = $new_noskip;
    } else {
        $batcache['noskip_cookies'] = array_unique(array_merge($batcache['noskip_cookies'], $new_noskip));
    }

    // Merge WCML/WPML cookie values into the unique cache key components.
    if ( !isset($batcache['unique']) || !is_array($batcache['unique']) ) {
        $batcache['unique'] = array();
    }
    $batcache['unique']['wcml_client_currency'] = isset($_COOKIE['wcml_client_currency']) ? $_COOKIE['wcml_client_currency'] : '';
    $batcache['unique']['wcml_client_currency_language'] = isset($_COOKIE['wcml_client_currency_language']) ? $_COOKIE['wcml_client_currency_language'] : '';
    $batcache['unique']['wcml_client_country'] = isset($_COOKIE['wcml_client_country']) ? $_COOKIE['wcml_client_country'] : '';
    $batcache['unique']['wp-wpml_current_language'] = isset($_COOKIE['wp-wpml_current_language']) ? $_COOKIE['wp-wpml_current_language'] : '';
}
// End Batcache Customizations

Option 2: Batcache customization for WPML  – Using a Separate skip-cache.php File

If you prefer not to modify wp-config.php file directly:

  • In the wp-content directory, create a new file named skip-cache.php
  • Add the batcache customization code snippet below:
/**
 * Batcache Customizations for WCML/WPML
 *
 * Ensures Batcache respects WooCommerce Multilingual and WPML cookies by:
 * - Skipping cache when specific cookies are present (`noskip_cookies`)
 * - Using cookie values as part of the unique cache key (`unique`)
 */

// Batcache Customizations
global $batcache;

// Check if batcache params are in an object or an array, apply customizations accordingly
if ( is_object( $batcache ) ) {

    // Merge WCML/WPML cookie names with existing noskip_cookies, or set them if not defined.
    $new_noskip = array(
        'wcml_client_currency',
        'wcml_client_currency_language',
        'wcml_client_country',
        'wp-wpml_current_language'
    );
    if ( !isset($batcache->noskip_cookies) || !is_array($batcache->noskip_cookies) ) {
        $batcache->noskip_cookies = $new_noskip;
    } else {
        $batcache->noskip_cookies = array_unique(array_merge($batcache->noskip_cookies, $new_noskip));
    }

    // Merge WCML/WPML cookie values into the unique cache key components.
    if ( !isset($batcache->unique) || !is_array($batcache->unique) ) {
        $batcache->unique = array();
    }
    $batcache->unique['wcml_client_currency'] = isset($_COOKIE['wcml_client_currency']) ? $_COOKIE['wcml_client_currency'] : '';
    $batcache->unique['wcml_client_currency_language'] = isset($_COOKIE['wcml_client_currency_language']) ? $_COOKIE['wcml_client_currency_language'] : '';
    $batcache->unique['wcml_client_country'] = isset($_COOKIE['wcml_client_country']) ? $_COOKIE['wcml_client_country'] : '';
    $batcache->unique['wp-wpml_current_language'] = isset($_COOKIE['wp-wpml_current_language']) ? $_COOKIE['wp-wpml_current_language'] : '';

} elseif ( is_array( $batcache ) ) {

    // Merge WCML/WPML cookie names with existing noskip_cookies, or set them if not defined.
    $new_noskip = array(
        'wcml_client_currency',
        'wcml_client_currency_language',
        'wcml_client_country',
        'wp-wpml_current_language'
    );
    if ( !isset($batcache['noskip_cookies']) || !is_array($batcache['noskip_cookies']) ) {
        $batcache['noskip_cookies'] = $new_noskip;
    } else {
        $batcache['noskip_cookies'] = array_unique(array_merge($batcache['noskip_cookies'], $new_noskip));
    }

    // Merge WCML/WPML cookie values into the unique cache key components.
    if ( !isset($batcache['unique']) || !is_array($batcache['unique']) ) {
        $batcache['unique'] = array();
    }
    $batcache['unique']['wcml_client_currency'] = isset($_COOKIE['wcml_client_currency']) ? $_COOKIE['wcml_client_currency'] : '';
    $batcache['unique']['wcml_client_currency_language'] = isset($_COOKIE['wcml_client_currency_language']) ? $_COOKIE['wcml_client_currency_language'] : '';
    $batcache['unique']['wcml_client_country'] = isset($_COOKIE['wcml_client_country']) ? $_COOKIE['wcml_client_country'] : '';
    $batcache['unique']['wp-wpml_current_language'] = isset($_COOKIE['wp-wpml_current_language']) ? $_COOKIE['wp-wpml_current_language'] : '';
}
// End Batcache Customizations
  • In your wp-config.php, file insert the following line include_once __DIR__ . '/wp-content/skip-cache.php'; immediately above the line:  /* That's all, stop editing! Happy blogging. */ then save the file

Clear Your Site’s Cache

After implementing the above changes, it’s essential to clear your site’s cache to experience the updates. You can follow Pressable’s guide on How to Clear Cache in WordPress for detailed instructions.​

You should see the response below in your site’s header to confirm that caching is working.

X-Ac: lhr _atomic_ams HIT
x-nananana: Batcache-Set

Check Your Site Header

  • Open your website in a browser > Right-click anywhere on the page and select “Inspect”
  • Go to the “Network” tab > Refresh the page
  • Click on the first request (usually your domain)
  • Go to the “Headers” section to view the response headers.

If you want to check via terminal or command line, you can use the below command:

curl -I https://yoursite.com