🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms German Address Format Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Fields & Inputs
On this page
  1. Video walkthrough
  2. Requirements
  3. Installation
  4. The three address types
  5. Field order
  6. Labels
  7. Street and house number
  8. Validation
  9. PLZ
  10. House number
  11. Required fields
  12. PLZ and Bundesland check
  13. Fill in the city from the PLZ
  14. The postal code data
  15. Entries, merge tags, notifications and exports
  16. Payment add-ons and other integrations
  17. Settings overview
  18. Translations
  19. If the licence runs out
  20. Frequently asked questions
  21. Does it change the Address fields I already have?
  22. Can a form take addresses from all three countries?
  23. Where is the house number saved?
  24. Does the autofill send the PLZ to a service?
  25. Is the postal code table complete?

Video walkthrough

Gravity Forms German Address Format: Straße, Hausnummer, PLZ Before Ort and City Autofill
Watch: set up German, Austrian and Swiss address formats with PLZ checks and city autofill in Gravity Forms, step by step. Watch on YouTube

The Gravity Forms German Address Format Premium Add-on gives the Gravity Forms Address field three address types: Germany, Austria and Switzerland. Each one has the order people in those countries expect, German labels, a separate house number input (or one merged input), an Adresszusatz line, an optional Bundesland or Kanton drop down and a fixed country. It checks the PLZ and the house number, can check that the PLZ fits the Bundesland, and can fill in the city from the PLZ using a postal code table that is bundled with the add-on.

The address is stored in the standard inputs of the Address field. Entries, merge tags, notifications, exports and payment add-ons that map a billing address keep working, and the add-on never calls another server.

A Gravity Forms address field for Germany with German labels: Straße and Hausnummer side by side, Adresszusatz, PLZ and Ort side by side and a Bundesland drop down, filled with Musterstraße 12a, Hinterhaus, 12345 Berlin
The Germany address type: street and house number side by side, PLZ before Ort, the Bundesland as an optional drop down. The country is fixed and hidden.

Requirements

  • WordPress 6.5 or newer and PHP 7.4 or newer (tested up to PHP 8.3).
  • Gravity Forms 2.9 or newer (tested with 2.9.8 and 3.1.2).
  • Nothing else. The postal code data is part of the add-on.

Installation

  1. Download the zip from your GravityExtra account and upload it in Plugins, Add New, Upload Plugin.
  2. Activate the plugin. Gravity Forms must be active.
  3. Go to Forms, Settings, German Address and activate your licence key.
  4. Open a form, add an Address field and choose the address type Germany, Austria or Switzerland.
The add-on settings in Forms, Settings, German Address: labels and messages in German or English, the house number input, the house number requirement, the Bundesland display, the postal code check and the autofill
One settings page. Every check and the autofill can also be switched on or off for each field in the form editor.

The three address types

In the form editor, click an Address field and open the Address Type list. Next to the standard types you will find Germany, Austria and Switzerland (Deutschland, Österreich and Schweiz on a German admin). Choosing one sets the country, hides the country drop down and changes the layout of the field.

Germany Austria Switzerland
Street label Straße Straße Strasse
Address line 2 Adresszusatz Adresszusatz (Stiege, Tür) Adresszusatz
PLZ 5 digits 4 digits 4 digits
Region list 16 Bundesländer 9 Bundesländer 26 Kantone
Region label Bundesland Bundesland Kanton
Country shown in entries Deutschland Österreich Schweiz

Field order

The inputs appear in this order: street and house number side by side, Adresszusatz, PLZ and Ort side by side, then the Bundesland or Kanton. The country is a hidden input that carries the fixed country. On a phone the street and the house number stack, so each input stays easy to tap. The layout works with the Orbital theme and with legacy markup.

Labels

Labels are German by default: Straße, Hausnummer, Adresszusatz, PLZ, Ort and Bundesland (Kanton in Switzerland, with Strasse written with ss). In Forms, Settings, German Address you can switch labels and messages to English. A label you typed in the field settings of the form editor always wins over the add-on.

Street and house number

By default the field has a separate input for the house number. The visitor types Musterstraße in one input and 12a in the other. When the form is sent, the add-on merges the two on the server, before Gravity Forms validates and saves the entry, so the entry stores one street value: Musterstraße 12a. This keeps merge tags, exports and every add-on that reads the street input working as before.

If you prefer one input, choose Merged with the street. The label becomes Straße und Hausnummer and the visitor types both in one input. You can set this for the whole site in Forms, Settings, German Address, and change it for single fields in the Advanced tab of the field settings.

The separate input also works without JavaScript, with Save and Continue, on multi-page forms and when a form is sent through the Gravity Forms API. An API client may send the street with the number in the street input and leave out the house number input; the add-on accepts that too.

Validation

PLZ

  • Germany: exactly 5 digits (00000 is refused).
  • Austria and Switzerland: exactly 4 digits, the first digit not 0.
  • Typed prefixes such as D-, DE-, A-, AT- and CH- are removed, and a PLZ typed as 12 345 is saved as 12345.
  • The message says how many digits are needed, for example Die PLZ muss aus 5 Ziffern bestehen.

House number

A house number is one to four digits, optionally followed by one letter. Two or three of these can be joined by a dash, a slash or a plus sign. These are valid: 12, 12a, 12 a, 12-14, 12a-14b, 12/3, 7+9. These are refused: 0, abc, 12ab, 12-, 12345. A street that starts with Postfach, Packstation, Case postale, Casella postale or PO Box needs no house number. You can switch the requirement off in the settings, and then a street without a number is accepted while a number that is typed must still be valid.

Required fields

A required Address field needs street, PLZ and Ort. The Bundesland or Kanton is always optional. If something is missing, one message names it, for example Dieses Feld ist erforderlich. Bitte ausfüllen: Straße, PLZ, Ort. A required message you typed in the field settings stays in front of the list of missing parts.

PLZ and Bundesland check

Switch on Check postal code against Bundesland or Kanton (settings page or field setting) and a PLZ must belong to the Bundesland or Kanton the visitor chose. If the visitor picked Hamburg and typed 80331, the message reads Die PLZ 80331 passt nicht zu Hamburg (erwartet: Bayern). A PLZ that crosses a state border lists both states and accepts either. A PLZ that is not in the table is accepted, and so is an empty Bundesland. The check is off by default.

Fill in the city from the PLZ

Switch on Fill in the city from the postal code and the add-on fills an empty city, and an empty Bundesland or Kanton, while the visitor types the PLZ. If a PLZ has several places, the main one is filled in and the others are offered as suggestions in the city input. A city the visitor typed is never changed; a city the add-on filled in is replaced when the PLZ changes. The autofill is off by default.

The data comes from a static file of the add-on, one file for each country. The browser reads that file from your own site, so no visitor data leaves the site and no outside service is involved. The file is only loaded on pages with a form that uses the autofill.

The postal code data

The table is made from the GeoNames postal code files for Germany, Austria and Switzerland (https://www.geonames.org), licensed under Creative Commons Attribution 4.0. It holds 10,815 postal codes for Germany (about 1,476 of them are company postal codes with no place or state; they are accepted without a check), 2,501 for Austria and 3,362 for Switzerland. A script, tools/build-plz-data.py in the add-on, builds the three files from the original download. The data is not an official register: new postal codes may be missing, and a postal code that is missing is accepted, never refused.

Entries, merge tags, notifications and exports

For fields of these types the address is written in the DACH format everywhere Gravity Forms prints a whole address:

Musterstraße 12a
Hinterhaus
12345 Berlin
Deutschland
  • The entry detail page, the Print Entry view and the entry list country column (the country is written as Deutschland, Österreich or Schweiz).
  • The all fields merge tag in notifications and confirmations, in plain text and in HTML.
  • The merge tag of the whole field, for example {Adresse:2}. Gravity Forms prints nothing for this tag on an Address field; this add-on prints the address block.
  • The merge tag of one input, for example {Adresse (PLZ):2.5}, {Adresse (Ort):2.3} or {Adresse (Straße):2.1}. The country input prints the German country name; add the modifier code to get DE, AT or CH.
  • The export: the whole field in one line (Musterstraße 12a, Hinterhaus, 12345 Berlin, Deutschland) and the standard column for each input.

In Forms, Settings, German Address you can add the Bundesland or Kanton after the city (12345 Berlin, Berlin). The link Map It, which Gravity Forms adds to addresses on the entry page, stays as Gravity Forms makes it, and the usual Gravity Forms filter removes it.

The Gravity Forms entry detail page in the WordPress admin showing the address in the German format: Musterstraße 12a, Hinterhaus, 12345 Berlin, Deutschland, on four lines
The entry shows the address the way it is written on an envelope. Merge tags, notifications and exports use the same order.

Payment add-ons and other integrations

The street, city, postal code and country are saved in the standard inputs of the Address field: input 1 is the street with the house number, input 2 the Adresszusatz, input 3 the city, input 4 the Bundesland or Kanton, input 5 the PLZ and input 6 the country. A payment add-on that maps a billing address (street, address line 2, city, state, ZIP and country) therefore gets the right values. The country is saved as the ISO code (DE, AT or CH) in Gravity Forms 3.0.3 and newer, and as the English country name in older versions, in the same way as the standard Germany, Canada or United States address types of Gravity Forms.

Settings overview

Setting Where Default
Labels and messages: German or English Settings page German
House number input: separate or merged Settings page, field Advanced tab Separate
House number required when a street is typed Settings page On
Show the Bundesland or Kanton in entries, merge tags and exports Settings page Off
Check the PLZ against the Bundesland or Kanton Settings page, field Advanced tab Off
Fill in the city from the PLZ Settings page, field Advanced tab Off

Translations

The settings screens and the form editor are translated into German for Germany (de_DE), Austria (de_AT) and Switzerland (de_CH, with ss instead of ß). The labels and messages on the form are German whatever the site language is, because the address type decides them, and each country has its own variant: Strasse and Kanton for Switzerland, Adresszusatz (Stiege, Tür) for Austria. A developer can change any label or message with the filter gfxdeaddr_texts.

If the licence runs out

Fields that use one of the three types fall back to the standard international Address field: the country stays as saved, the add-on layout and checks are off, and every entry keeps its values. Activate the licence again and the types are back.

Frequently asked questions

Does it change the Address fields I already have?

No. Only fields where you choose Germany, Austria or Switzerland change. All other address types stay as they are.

Can a form take addresses from all three countries?

Use one Address field for each country, or ask for the country first and show the matching field with conditional logic. Each type has a fixed country.

Where is the house number saved?

Together with the street in the street input, as Musterstraße 12a. There is no extra stored input.

Does the autofill send the PLZ to a service?

No. The data file is part of the add-on and is read from your own site.

Is the postal code table complete?

It is a community data set, not an official register. A postal code that is not in the table is accepted.

Collect addresses in Germany, Austria and Switzerland that you can ship to

See the German Address Format add-on

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr