Skip Navigation

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.

Our next available supporter will start replying to tickets in about 4.49 hours from now. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 7 months, 1 week ago.

Assisted by: Minesh.

Author Posts
September 15, 2023 at 6:20 pm #14405167

thomasF-47

I try to translate the user contact field "Website", which is standard in WordPress.

It seems I need to add some additional code to the function.php, as you haven't prepared this field to be translated by default (I only can translate Username and Biography/Description).

I am referring to this article:
https://wpml.org/documentation/getting-started-guide/string-translation/translating-user-meta-information-with-wpml/

How do I find out the name of the field "website" and if I insert this code into the child theme's functions.php:

add_filter( 'wpml_translatable_user_meta_fields', function( $fields ) {
$fields[] = 'website';
return $fields;
} );

will I see the website field to translate in the String Translation immediately? Could you please guide me how to do thîs? The code above didn't work and I don't know why, maybe the field name is wrong or something different.

Thank you.

September 18, 2023 at 12:27 pm #14411837

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the WPML support.

To translate the Website field available on user profile page, you should add the said filter to your child theme's functions.php file as already shared with the Doc:

The correct slug for the "Website" field user field is url.

You should try to add the following code to your child theme's functions.php file:

add_filter( 'wpml_translatable_user_meta_fields', function( $fields ) {
$fields[] = 'url';
return $fields;
} );

And then you should navigate to WPML => String Translation and under the section "More options" you should set your desired role of your user you want to translate the fields and click on the "Apply" button. Please check the following screenshot: hidden link

Then you should filter the string for "Authors" domain and you should be able to see the field.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.