Description
Address Lookup field for ACF adds an address lookup field type to Advanced Custom Fields. Users can search for addresses directly within the editor, and the field returns structured address data including coordinates.
The plugin uses Nominatim (OpenStreetMap) as the default lookup provider, and supports registering custom providers.
Features
- Live address search — AJAX-powered search as you type, using Select2.
- Structured data — Returns a normalized array with display name, coordinates (lat/lon), house number, road, city, state, postcode, and country.
- Country code filtering — Limit search results to specific countries.
- Language support — Set the preferred language for results.
- Extensible provider system — Register your own address lookup providers via the
address_lookup_for_acf/register_providersaction. - REST API support — Field values are exposed in the REST API.
Usage
- Install and activate the plugin.
- Create or edit an ACF field group.
- Add a new field and select the Address field type.
- Optionally configure country code filtering and language.
- Use
get_field()orthe_field()in your templates — the value is returned as an associative array.
Template example
$address = get_field('my_address_field');
The returned array has the following structure:
[
'display_name' => 'Example Street 1, City, Country',
'coordinates' => ['lat' => '52.370216', 'lon' => '4.895168'],
'house_number' => '1',
'road' => 'Example Street',
'city' => 'City',
'state' => 'State',
'postcode' => '1234 AB',
'country' => 'Country',
]
Custom providers
You can register a custom address lookup provider by hooking into the jk_address_lookup_for_acf/register_providers action:
add_action('jk_address_lookup_for_acf/register_providers', function ($registry) {
$registry->register(new MyCustomProvider());
});
Your provider must extend justinkruit\AddressLookupForAcf\Providers\AbstractProvider and implement the name(), label(), and search() methods.
Filters
jk_address_lookup_for_acf/nominatim_url— Override the Nominatim API base URL (e.g. to use a self-hosted instance).jk_address_lookup_for_acf/nominatim_url_vars— Modify the query parameters sent to the Nominatim API.
Both filters also support ACF’s field-specific variations by type, name, and key.
External services
This plugin connects to third-party external services to perform address lookups. No data is sent automatically; requests are only made when an admin user actively searches for an address in the ACF field editor. The search query text is sent to the configured provider’s API.
Below is a list of each provider, what additional data is sent, how to override the API URL, and links to their terms and privacy policies.
Nominatim (OpenStreetMap)
Service: Nominatim by the OpenStreetMap Foundation: used for geocoding address searches.
Additional data sent: configured country code(s) and language preference (if set in the field settings).
Override URL: use the jk_address_lookup_for_acf/nominatim_url filter to point to a self-hosted instance.
Policies:
Installation
- Upload the
address-lookup-for-acffolder to the/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- Ensure Advanced Custom Fields (free or PRO) is installed and active.
FAQ
-
Does this plugin require ACF PRO?
-
No. It works with both the free and PRO versions of Advanced Custom Fields.
-
Can I use a self-hosted Nominatim instance?
-
Yes. Use the
jk_address_lookup_for_acf/nominatim_urlfilter to point to your own instance:add_filter('jk_address_lookup_for_acf/nominatim_url', function () { return 'https://nominatim.example.com/search'; }); -
What PHP version is required?
-
PHP 7.2 or higher is required.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“JK Address Lookup field for ACF” is open source software. The following people have contributed to this plugin.
Contributors“JK Address Lookup field for ACF” has been translated into 1 locale. Thank you to the translators for their contributions.
Translate “JK Address Lookup field for ACF” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial release.
- Nominatim (OpenStreetMap) provider.
- Country code filtering and language settings.
- Extensible provider architecture.
