Skip Navigation

[Resolved] LatLng fields names to import with WP All Import

This thread is resolved. Here is a description of the problem and solution.

Problem:
Importing content that has lat/lon coordinates with WP All Import, what field names should be used to include the coordinates with the imported posts?

Solution:
Add a Types address field—available with the Toolset Maps plugin—to the post type. This will be stored as post meta with a key of the field slug prefixed with 'wpcf-', e.g. a "location" custom field would be stored as 'wpcf-location'.

Normally these store an address as a string, but can also store comma separated lat/lon coordinates, e.g. "55.9485977,-3.2021022"

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by romanB-3 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#596930

Hello,
I use WP All Import to import datas with LatLng.
My custom field is "wpcf-geolocalisation", so I tried to set "wpcf-geolocalisation-latitude" and "wpcf-geolocalisation-longitude" with no effect.
How should I name those fields to make the import working ?
Thank you.

#597030

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

The address field is normally used to store an address as a string (in the format returned by the Google API). All of the lat/lon coordinates are then cached by Views and stored in the wp_options table, in a format you would not be able to reproduce when importing.

You can, however, simply store the comma-separated lat/lon values directly in the address field (e.g. "55.9485977,-3.2021022") but you would have no associated text address, and it is impossible to import the data in such a way as to have the text address and the coordinates.

If you just store the address then Views will use the API to look up the coordinates (and then cache them).

#597220

Great. Thank you.