
Este plugin es un addon para Contact Form 7 que permite listar ciudades y departamentos de Colombia.
This plugin is an addon for Contact Form 7 that lets you list Colombian departments and cities. To list departments use: [dycccf7_state department]. To list cities use: [dycccf7_city city]. The city field automatically filters its options based on the department selected in the same form.
Features
- Two form-tag types: department dropdown and city dropdown.
- The city list updates automatically to match the selected department.
- Server-side validation confirms the submitted department and city actually belong to the official list, not just that the field isn’t empty.
- Script and data are only loaded on pages where the form actually uses these fields.
- Works correctly with multiple form instances on the same page.
Screenshots
![The <code>[dycccf7_state]</code> and <code>[dycccf7_city]</code> form-tags in the Contact Form 7 editor.](https://ps.w.org/departamentos-y-ciudades-de-colombia-para-contact-form-7/assets/screenshot-1.png?rev=2785003)
The [dycccf7_state] and [dycccf7_city] form-tags in the Contact Form 7 editor.

The department and city dropdowns on the front end.
FAQ
How do I add the departments list?
Use the following form-tag in the Contact Form 7 editor: [dycccf7_state department]
Can I use the departments list on its own?
Yes, just use the [dycccf7_state department] form-tag.
Can I use the cities list on its own?
No, the department form-tag is required for the city field to work.
ChangeLog
1.3.1
- Fixed: the plugin’s text domain now matches its slug, and internal function names use a consistent prefix.
- Removed the bundled translation files; translations are now handled entirely through translate.wordpress.org.
1.3.0
- Fixed: forms with more than one instance of the department/city fields no longer collide by sharing the same id; each instance now works independently.
- Fixed: the dropdowns now reset correctly when the form reloads or is added dynamically to the page (AJAX submissions, popups, etc.).
- Fixed: the
id: option from the CF7 tag editor is now respected and reflected in the HTML.
- Fixed: the city field no longer renders if the form does not also include a department field (previously it stayed permanently disabled and unusable).
- Security: added server-side validation so the submitted department and city actually match the official list (previously only checked that the field wasn’t empty).
- Performance: the script and department/city data now only load on pages where the form actually uses these fields, instead of on the whole site.
- Performance: Colombia’s data was centralized into a single JSON file, avoiding duplication between PHP and JavaScript.
- Added translation support: the plugin’s base language is now English, with Spanish translations included (es_ES and es_CO).
1.2.0
- Code refactor.
- Added a check for the required CF7 plugin.
- Fixed an error shown when the field is required.
1.0.0