Managing WordPress users often requires recording custom information about each user and sometimes you might need to extend the default WordPress user options in order to create a customized profile of your users. The Custom Fields feature of Users Insights allows you to extend the default WordPress user options. It provides a seamless interface to register custom fields and update the fields data for each user. Moreover, the custom fields are automatically added to the Users Insights filters, so you can filter your WordPress users by your custom fields data.
The Custom Fields are registered as user meta fields. This can be very beneficial if you already have some custom user meta fields applied to your users. In this case you will be able to use the already registered fields and load the saved data for each user. Another benefit of having the custom fields registered as user meta fields is that you can use the existing WordPress user meta functions if you would like to print the saved data somewhere else on your site.
Registering Custom User Meta Fields
You can register custom user meta fields in the Custom Fields section of Users Insights:
When creating a custom field, you can set the name of the field, key of the field and type of the field. The key of the field is the key that will be saved in the user meta table. If you would like to use already registered meta fields, you can just insert the existing user meta key into the field key. The type of the field sets what type of data the field will store. At this point the supported types are text and number.
Once the field is created, you can later update it – you can modify all of its options, except the key. You can also delete the field if you no longer need it.
Updating the custom fields data for each user
Once the custom fields are registered, you can preview and update the data for each user in the user profile section of the Users Insights page. All of the custom fields are automatically added to the profile data and would list any existing data:
You can edit each of the custom fields by clicking on the Edit icon:
Different input types are generated depending on the type of the field – for example, if it is a number field, a number input would be available to update the data.
Updating the custom fields data is performed seamlessly with AJAX, without requiring a page refresh.
Listing the custom fields in the Users Insights table
All of the registered custom user meta fields are available as columns in the Users Insights table. Here is an example that shows the “Age”, “Phone number” and “Occupation” custom fields:
Like the rest of the columns, you can sort the WordPress users list by any of these columns (ascending or descending). You can also hide any of these columns if you don’t need them to be visible.
Filtering the WordPress users by custom user meta fields
All of the custom user meta fields are also available in the Users Insights filters, so you can easily filter your WordPress users by any of these fields. The filter automatically detects the type of field and would provide conditions accordingly. For example, the text field would include conditions like “contains”, “starts with”, etc. and the number field would include conditions like “is bigger than” and “is smaller than”:
Here is an example of showing the users with age smaller than 30:
And here is another example of filtering the users by their occupation – we want to find all the users whose job is related with marketing:
Here is a short video that is showing how to create custom user field, how to add data to the custom user field and how to use the smart filters with the custom user fields:
Loading existing user meta data (from other plugins)
Many plugins use the WordPress user meta to store additional information about the users. You can load this existing data into the user table with the help of the Custom Fields feature of Users Insights. All you need to do is when creating a custom user field, instead of adding a new field key, to use an already existing user meta key from your database. You can learn more about how to load the existing user meta data into your custom user fields in this article.
Exporting custom user meta fields data
Just like the default Users Insights fields, the custom fields can be exported in a CSV format by using the Users Insights export feature. Just by making the custom fields columns visible, they will be automatically added to the export file. You can also use the filters to segment the exported data. For example, if we choose to export all the users, whose job is related with marketing (as per the example above), we will have the following export file:
Exploring users location with custom fields filters
If you have the Geolocation module activated, you can also explore your users locations after applying custom fields filters. Following the example above, where we filter the users by their occupation, we can also preview the results on the map view:
The feature to create and update custom user fields also is one of the key features of a CRM system. Being able to create custom profiles for your WordPress users can benefit the user management in many different ways. You can keep record of custom user data and you can use the powerful features of Users Insights to analyze this data and make sense of it.