Skip Navigation

[Resolved] How to add a list of 199 countries into multiple custom fields seemlessly?

This support ticket is created 4 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#1564509

Hi, I am creating a custom field, type "Checkboxes", slug "country-of-origin". There are 199 countries in my excel file list.

1. I have read that I can import this list into a custom field using an importer. Or I can also create a database and link it to the custom field.

Which of the options is better? I want to reuse the list in other custom fields as well. Can you please show me step by step of how to do so?

2. I am using the content template to show the custom field. How do I show the value of the multiple checkboxes if it is imported from a database (option 2 above)?

I have manually created the 199 checkboxes custom fields before. But to create another custom field with the same 199 countries, it is a lot of work. Sometimes I can not add any checkboxes anymore for unknown reasons.

#1565055

Hello,

I don't think it is a good idear to setup a custom checkboxes field with 199 options, it will conduct other unexpected result.

I suggest you try with custom hierarchical taxonomy, see our document:
https://toolset.com/documentation/user-guides/custom-content/create-custom-taxonomies/
Hierarchical taxonomy works just like post categories. It appears as a tree and you have checkboxes to select taxonomy terms.
See screenshot:
https://toolset.com/wp-content/uploads/2011/10/categories.jpg

The taxonomy is WordPress built-in feature, with it, you can manage the taxonomy terms easily, and filter the result by taxonomy:
https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/

Group the posts by taxonomy terms:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/

For example, you can create a hierarchical taxonomy "Country", the taxonomy slug is "country", and use custom codes to import the taxonomy data, see similar post here:
https://wordpress.stackexchange.com/questions/26420/fast-way-to-add-countries-as-a-custom-taxonomy-term

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.