{"id":949,"date":"2025-03-24T14:28:06","date_gmt":"2025-03-24T14:28:06","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-translate-custom-fields-with-wpml\/"},"modified":"2025-04-03T15:24:27","modified_gmt":"2025-04-03T14:24:27","slug":"how-to-translate-custom-fields-with-wpml","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/translations\/how-to-translate-custom-fields-with-wpml\/","title":{"rendered":"How to Translate Custom Fields with WPML"},"content":{"rendered":"\n<p>If your site is in more than one language, you can use the <a href=\"https:\/\/wpgeodirectory.com\/docs\/useful-plugins\/#wpml\">WPML<\/a> plugin to manage translations and translated content. The instructions below may vary slightly with different versions of WPML. The&nbsp;<em style=\"background-color: initial;\">String Translation<\/em>&nbsp;module is only available in the&nbsp;<em style=\"background-color: initial;\">Multilingual CMS<\/em>&nbsp;version of the plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Translating Custom Fields using WPML&#8217;s String Translation module<\/h2>\n\n\n\n<section>\n<p>The&nbsp;String Translation module&nbsp;is only available in the <a href=\"https:\/\/wpml.org\/purchase\/\">WPML Multilingual CMS version<\/a><\/p>\n<\/section>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Make sure you have selected to use\u00a0String Translation, use one of the two options:<figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-Bxt7bAH1DT.png 943w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-Bxt7bAH1DT-300x72.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-Bxt7bAH1DT-768x184.png 768w\" width=\"920\" height=\"220\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-Bxt7bAH1DT.png\" alt=\"\"><\/figure><\/li>\n\n\n\n<li>Create your custom field, and enter description, front end title etc. For this example we are creating a text field:<figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-YZLQ41cdUu.png 543w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-YZLQ41cdUu-300x182.png 300w\" width=\"543\" height=\"329\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-YZLQ41cdUu.png\" alt=\"\"><\/figure><\/li>\n\n\n\n<li>Then go to\u00a0GeoDirectory > Status > Tools > DB text translation:<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6TfAEt97fU.png 719w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6TfAEt97fU-300x71.png 300w\" width=\"719\" height=\"171\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6TfAEt97fU.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>This will scan the database for custom fields and copy them to a file in your\u00a0geodirectory\u00a0plugin folder called\u00a0<em>db-language.php<\/em><\/li>\n\n\n\n<li>WPML\u00a0will now be able to scan this file and allow you to translate the custom fields. Go to\u00a0WPML > Theme and plugins localization > Strings in the plugins > GeoDirectory > Scan selected plugins for strings<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6wU7c9v3xG.png 704w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6wU7c9v3xG-300x107.png 300w\" width=\"704\" height=\"251\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-6wU7c9v3xG.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>To translate them go to\u00a0WPML > String Translation, where you will see the new fields added:<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-LgH4yUEUqu.png 483w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-LgH4yUEUqu-300x129.png 300w\" width=\"483\" height=\"208\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-LgH4yUEUqu.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>Now you can translate them and save:<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-vmgcHHnLXc.png 481w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-vmgcHHnLXc-300x205.png 300w\" width=\"481\" height=\"329\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-vmgcHHnLXc.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>This would be the result on the Add Listing page:\u00a0<em>French<figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QxzZ44QTjZ.png 529w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QxzZ44QTjZ-300x43.png 300w\" width=\"529\" height=\"75\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QxzZ44QTjZ.png\" alt=\"\"><\/figure><\/em><em>English<figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JAtuJ4h18x.png 529w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JAtuJ4h18x-300x45.png 300w\" width=\"529\" height=\"79\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JAtuJ4h18x.png\" alt=\"\"><\/figure><\/em><em>Dutch<figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-OdQkEdRRHk.png 529w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-OdQkEdRRHk-300x47.png 300w\" width=\"529\" height=\"83\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-OdQkEdRRHk.png\" alt=\"\"><\/figure><\/em><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><em>Translating Custom Fields without WPML&#8217;s&nbsp;String Translation module<\/em><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If you are only using the <a href=\"https:\/\/wpml.org\/purchase\/\">WPML Multilingual blog<\/a> plugin, then first follow steps 2\u00a0and 3\u00a0as explained above.<\/li>\n\n\n\n<li>That will create a file called\u00a0<em>db-language.php<\/em>\u00a0that you will find in your\u00a0<em>geodirectory<\/em>\u00a0folder on the server.<\/li>\n\n\n\n<li>Copy all files in the\u00a0<em>geodirectory<\/em>\u00a0folder to\u00a0your computer:<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xVfZ4Qsz66-1.png 572w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xVfZ4Qsz66-1-300x173.png 300w\" width=\"572\" height=\"330\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xVfZ4Qsz66-1.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>Open the\u00a0\/wp-content\/plugins\/geodirectory\/geodirectory-languages\/geodirectory-en_US.po\u00a0file with <a href=\"https:\/\/poedit.net\/\">poEdit<\/a>:\u00a0<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-i4NrOIqIVS-1.png 569w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-i4NrOIqIVS-1-300x83.png 300w\" width=\"569\" height=\"158\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-i4NrOIqIVS-1.png\" alt=\"\"><\/figure><br><\/li>\n\n\n\n<li>From the\u00a0catalogue\u00a0menu, choose\u00a0Update from sources &#8230;:\u00a0<br><figure><img loading=\"lazy\" decoding=\"async\" width=\"301\" height=\"75\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JuDRmweWaA-1.png\" alt=\"\"><\/figure><\/li>\n\n\n\n<li>That will re-build the\u00a0geodirectory-en_US.po\u00a0file:<br><figure><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 375px) 100vw, 375px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-M48gnilEgp-1.png 375w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-M48gnilEgp-1-300x111.png 300w\" width=\"375\" height=\"139\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-M48gnilEgp-1.png\" alt=\"\"><\/figure><\/li>\n\n\n\n<li>Save the file.<\/li>\n\n\n\n<li>You now have a new base language file including the new custom fields. You can now use that file to create your other language files, read more at <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-translate-or-localize-geodirectory\/\">How To Translate Or Localize GeoDirectory<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>If your site is in more than one language, you can use the WPML plugin to manage translations and translated content. The instructions below may vary slightly with different versions of WPML. The&nbsp;String Translation&nbsp;module is only available in the&nbsp;Multilingual CMS&nbsp;version of the plugin. Translating Custom Fields using WPML&#8217;s String Translation module The&nbsp;String Translation module&nbsp;is only [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[627,811,812],"article\/categories":[211,432,434],"class_list":["post-949","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-wpml","gd_place_tags-wpml-fields","gd_place_tags-wpml-custom-fields","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos","gd_placecategory-translations"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=949"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/949\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=949"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=949"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}