How to Password Protect Multilingual Content with WPML

By default, Password Protect WordPress (PPWP) Pro will synchronize passwords of the page in the main language with the pages in other languages.

In this article, we will show you how our plugin PPWP Pro works with WordPress Multilingual Plugin (WPML).

Requirements:

Auto-protect multilingual content

Since PPWP Pro version 1.3.5, when you protect a page in the main language, the corresponding sub-language pages will be protected automatically with the same passwords.

Content protection in the main language page

Therefore, if you unlock the content in the main language, you’re unlocking the content in other languages as well.

Please note that:

  • You can protect a page and manage its passwords in the default language only.
    • The protection functions in the sub language pages, including “Protect” button link and password configuration popup, will disappear while the switch button in the editor page will be disabled.
Content protection in the sub-language page
    • If you create a page in the sub-language, you won’t be able to protect it. You have to switch to the default language first.
    • You can choose to protect content in different languages separately using a custom code.
  • Once a page is (un)protected, all its copies under sub-languages will be (un)protected accordingly.
    • In other words, the protection status and passwords will follow the ones under the default language.
    • In case the content in sub-languages is already protected before you upgrade to PPWP Pro version 1.3.5, its passwords will be disabled.

Separate protection in multilingual content

In case you want to protect the pages in different languages separately, simply add the following code snippet to your (child) theme’s functions.php file.

add_filter( 'ppwp_wpml_using_main_language', '__return_false' );

As a result, you can set the password for each page individually, and protecting a page in the main language won’t make its copies in other languages protected anymore.

Lasted updated on April 9, 2021