Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 0 voices.

Last updated by Itamar 1 week ago.

Assisted by: Itamar.

Author Posts
August 22, 2025 at 6:10 pm #17341271

krisztianG-2

Background of the issue:
Hi,
We have a real estate website listing new developments.
The title is the name of the development.
We would like to use automatic translation (Google) and exclude the title from translation.
The official Quick solution is 2,5 years old does not work with the current version of WPML.
https://wpml.org/forums/topic/do-not-translate-title-with-automatic-translation/

Symptoms:

Questions:
Please provide a working solution to exclude the title from automatic translation

August 24, 2025 at 9:59 am #17343059

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This is a feature request that our developers need to discuss whether to include in WPML's options. I've adjusted the filter function to match your case, as I assume it is about the 'property' post type. Please try to use it like this:

add_filter('wpml_tm_job_field_is_translatable', 'testfield', 10, 2);
function testfield($is_translatable, $job_translate){
    global $wpdb;
    $postid = $wpdb->get_var( $wpdb->prepare("SELECT `field_data` FROM `wp_icl_translate` WHERE `field_type` = 'original_id' AND `job_id` = %d", $job_translate["job_id"] ));
    $posttype = get_post_type($postid);
    if ($job_translate["field_type"] == "title" && $posttype == "property") {
      return false;
    } else {
      return true;
    }
}


**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Regards,
Itamar.

August 24, 2025 at 11:27 am #17343099

krisztianG-2

Hi,

Thank you for the code, it is still not 100%

We have for example 2 developments:
Mobius Villas 157A and Mobius Villas 157B

Without your code PTC translated the name to:
Mobius Villák 157A --> Villas has been translated to Villák
/hu/ingatlan/mobius-villak-157a/ --> the slug is also translated

Google with you code translated it to:
Möbius Villas 157B --> Mobius has been translated to Möbius, Villas is untouched
/hu/ingatlan/mobius-villas-157b/ --> the slug is fine

So I think the code needs some fine-tuning.

Thank you!

August 28, 2025 at 9:50 am #17354292

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I apologize for the delayed response.

According to one of our developers, here is an adjusted function.

add_filter('wpml_tm_job_field_is_translatable', 'testfield', 10, 2);
function testfield($is_translatable, $job_translate) {
    global $wpdb;
    
    $postid = $wpdb->get_var( 
        $wpdb->prepare(
            "SELECT `field_data` FROM `wp_icl_translate` WHERE `field_type` = 'original_id' AND `job_id` = %d", 
            $job_translate["job_id"] 
        ) 
    );

    // Check if post ID is valid
    if ( ! $postid ) {
        return $is_translatable;
    }

    $posttype = get_post_type($postid);

    if ($job_translate["field_type"] == "title" && $posttype == "property") {
        return false;
    }

    return $is_translatable;
}

Does it meet your needs?

Regards,
Itamar.

August 28, 2025 at 10:50 pm #17356437

krisztianG-2

Hi,

unfortunately this does not work too.

'Navigolf Suites' has been translated to 'Navigolf lakosztályok'

Is this method supported for all translation engines? I have tested it with Google.

Thank you!

August 31, 2025 at 8:56 pm #17360935

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Could you please grant me access to your site and direct me to where I can view this issue?

If you require additional assistance with this, please share the access details to your site with me. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please back up the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

September 1, 2025 at 6:18 am #17361211

krisztianG-2

Dear Itamar,

we couldn't wait any longer and after 2 non working suggestions we decided to build a custom plugin that translates the properties.

You can close the ticket but keep it unresolved as the original problem is still there. We just do not need a solution for that anymore.

WPML is a quite complex plugin I do not understand why your developers do not plan to implement such a basic feature.

Thank you for all your efforts!

Krisztián

September 1, 2025 at 8:00 am #17361565

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi Krisztián.

Thanks for updating me on this. I understand that you need this feature. I'm sorry that our suggestions didn't work for you, and you had to code a plugin for this. This issue has been escalated to our developers and tagged as a feature request. Only they and management have a broader view of things and prioritize feature development, among other things, upon demand. I have no option but to close the ticket without marking it as resolved. However, if you do not reply to this thread, our system will automatically close it after approximately one week.

Regards,
Itamar.