Skip to content

Commit

Permalink
WordPress plugins: update the polylang cookie solution (#8882)
Browse files Browse the repository at this point in the history
* WordPress plugins: update the polylang cookie solution

The previous solution removed the polylang cache key. The new solution makes the cookie a cache-varying cookie which is a better and more reliable solution

* Copy edits

---------

Co-authored-by: Joey Kudish <[email protected]>
Co-authored-by: Rachel Whitton <[email protected]>
  • Loading branch information
3 people authored Jul 12, 2024
1 parent 4fe4daa commit 7ecb004
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/content/plugins-known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cms: [wordpress]
audience: [development]
product: [--]
integration: [--]
reviewed: "2023-01-30"
reviewed: "2024-07-12"
---

This page lists WordPress plugins, themes, and functions that may not function as expected or are currently problematic on the Pantheon platform. This is not a comprehensive list (see [other issues](#other-issues)). We continually update it as problems are reported and/or solved. If you are aware of any modules or plugins that do not work as expected, please [contact support](/guides/support/contact-support/).
Expand Down Expand Up @@ -713,18 +713,18 @@ ___

## PolyLang

<ReviewDate date="2023-11-15" />
<ReviewDate date="2024-07-12" />

**Issue:** The [PolyLang](https://wordpress.org/plugins/polylang/) plugin adds a cache-busting cookie (ex. `pll_language=en`) for each request.

**Solution:** Define the constant `PLL_COOKIE` to false in `wp-config.php` to remove the cookie:
**Solution:** Define the constant `PLL_COOKIE` to `STYXKEY_pll_language` in `wp-config.php` to make the cookie a cache-varying cookie.

```php:title=wp-config.php
// Disable Polylang's feature to set a cookie that stores the visitor's selected language.
define('PLL_COOKIE', false);
// Set the polylang cache key to be edge cache compliant
define('PLL_COOKIE', 'STYXKEY_pll_language');
```

The value of `PLL_COOKIE` defaults to `pll_polylang`. This defines the name of the cookie used by Polylang to store the visitor's language. When `PLL_COOKIE` is set to false, Polylang does not set any cookie. Be aware that in this case some features of the plugin may not work completely. For example, the login page will not be translated.
The value of `PLL_COOKIE` defaults to `pll_polylang`. This defines the name of the cookie used by Polylang to store the visitor's language. By changing `PLL_COOKIE` to `STYXKEY_pll_language` the cookie will become a [cache-varying cookie](/cookies#cache-varying-cookies).

See the [plugin documentation](https://polylang.pro/doc/php-constants/) for more information on its PHP constants.

Expand Down

0 comments on commit 7ecb004

Please sign in to comment.