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 field types are:
- text – allows entering a variable string
- number – for numeric values
- date (read only) – the date field is designed to be read only, to read user meta for 3rd party plugins
- dropdown select – allows you to specify a set of available options to choose from
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. The field input will be automatically determined by the selected field type. For example, for select fields there will be a dropdown to select from the preset options.
Updating the custom fields data is performed seamlessly with AJAX, without requiring a page refresh.
Additionally, the user profile section provides some field management tools that can help you organize your custom fields. You can easily reorder and hide the fields, as well as add section titles to group the fields. This feature can be especially useful when having a large number of custom fields.
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 greater 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:
If you have a dropdown custom field, where you can select an option from a preset list, you can also filter your users based on this field. The filters allow you to find all users whose value match or does not match the selected value. There are also the “is set” and “is not set” operators that you can use to segment the users based on whether they have this field updated with a value or not.
In situations when we need more something more specific we can use some of the more sophisticated Users Insights filters to perform custom field searches. For instance, we may want to search all users with a telephone number in a certain area code. It’s possible to search text custom fields based on their entire content, their beginning or their ending.
Sometimes though, we may need to search users based on field that contains certain data. For this we can use the filter “Contains:
This same search can be done with their last name or even their username. In this way, you can find users even if you recall just bits of information.
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.
In addition to manually adding the custom field keys, you can use the Extended CRM for Users Insights plugin. This plugin allows you to search custom fields from your WordPress database. In this way, you don’t even need to know the custom field keys.
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.