Title: WPML compatibility
Last modified: March 5, 2022

---

# WPML compatibility

 *  Resolved [mickhele](https://wordpress.org/support/users/mickhele/)
 * (@mickhele)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/wpml-compatibility-252/)
 * How can I apply automatically the same “search exclude” settings to the others
   pages translated?
    Now I’ve to open every page translated and set manually the“
   search exclude”.

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

 *  Plugin Contributor [pronskiy](https://wordpress.org/support/users/pronskiy/)
 * (@pronskiy)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/wpml-compatibility-252/#post-15437817)
 * Hi!
 * It is possible but may require a bit of coding.
 * Off the top of my head, adding the following code to your `functions.php` should
   help:
 *     ```
       function update_wpml_translations($post_id)
       {
       	if (!isset($_POST['sep'])) return $postId;
   
       	$sep = $_POST['sep'];
       	$exclude = (isset($sep['exclude'])) ? filter_var($sep['exclude'], FILTER_VALIDATE_BOOLEAN) : false;
   
       	$post_ids = [$post_id];
       	$languages = apply_filters( 'wpml_active_languages', null );
       	foreach ($languages as $language) {
       		$post_ids[] = apply_filters( 'wpml_object_id', $post_id, 'page', true, $language );
       	}
   
       	do_action('searchexclude_hide_from_search', $post_ids, $exclude);
       }
       add_filter('post_updated', 'update_wpml_translations', 10, 2);
       ```
   
 * ❗️ Not tested ❗️
 *  Thread Starter [mickhele](https://wordpress.org/support/users/mickhele/)
 * (@mickhele)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/wpml-compatibility-252/#post-15438379)
 * Ok, thanks!

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

The topic ‘WPML compatibility’ is closed to new replies.

 * ![](https://ps.w.org/search-exclude/assets/icon-256x256.png?rev=2916925)
 * [Search Exclude](https://wordpress.org/plugins/search-exclude/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-exclude/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-exclude/)
 * [Active Topics](https://wordpress.org/support/plugin/search-exclude/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-exclude/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-exclude/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mickhele](https://wordpress.org/support/users/mickhele/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/wpml-compatibility-252/#post-15438379)
 * Status: resolved