Automatically Manage Postal Codes and INSEE Codes in Your LimeSurvey surveys

Obtaining a reliable town name in a survey can quickly become complicated. Between homonyms, abbreviations, and the lack of associated information — such as the postal code or the INSEE code — the collected data often requires extensive cleaning work..

The cpVille plugin addresses this issue by integrating an internal database of French municipalities into LimeSurvey, complete with autocomplete and automatic insertion of essential identifiers.

Why Use the cpVille Plugin?

In many surveys, respondents provide only a town name—often incomplete, misspelled, or ambiguous. The cpVille plugin automatically enriches this information by providing:

  • intelligent search through a large database of French municipalities
  • instant suggestions as the user types
  • automatic insertion of the INSEE code
  • automatic insertion of the postal code
  • normalization of common abbreviations (e.g. st → saint, ste → sainte, / → sur)

Result: clean, reliable, and directly usable data—without any time-consuming manual processing.

Download the Plugin

(Tested with LimeSurvey versions 6.3 and 6.15)

Adding a CP/City Question to Your Survey

It couldn’t be easier: download the LSS source file and import the question directly into your survey group.

View the online demo

The question template will automatically populate:

  • the corresponding INSEE code
  • the postal code

based on the town typed by the respondent.

How Does the Search Work?

1. Search by town name

As soon as the user begins typing, the plugin scans its internal database and displays relevant suggestions.

2. Search by postal code

If the user enters only numbers, the plugin switches to a postal-code search.

3. Combined search

When two text elements are typed (e.g., saint bre), the module intelligently filters results to narrow down the selection.

4. Linguistic enhancements

To improve the user experience:

  • st is expanded to saint
  • ste becomes sainte
  • / is replaced with sur
  • users can restrict the search to a department by typing its two-digit department code

A smooth, fast, and intuitive system designed to ensure accurate data entry from the very first keystroke.

Credits and Data Licensing

The plugin relies on an internal database of French municipalities.

What Is the INSEE Code?

The INSEE code (also called the commune INSEE code) is a unique numerical identifier assigned by the INSEE (National Institute of Statistics and Economic Studies) to every municipality in France.

It enables reliable and standardized identification of each commune, regardless of:

  • name changes
  • homonyms (towns with identical names)
  • modifications of territorial boundaries
  • postal codes sometimes shared by several towns