X Buy Features Demo (Cars) Demo (Power Plants) Demo (Map) Showcase Add-ons Docs Changelog

User Post Type

This plugin is available to Professional license holders

The User Post Type plugin lets you connect users to a post type, so that you can create user listings and filter users like any other post type 🙂

How it works

The plugin adds a new hidden upt_user post type, and adds a post for each user. It links the two via the _upt_post_id usermeta.


Browse to Settings > User Post Type and click the “Sync now” button.

As seen above, you can also copy extra data into the postmeta table. This is not required to display fields — it’s only useful for meta_query. See the “Displaying a subset of users” section.

Here’s a list of dropdown choices and corresponding meta_query keys:

Option Meta Key
User ID ID
User Login user_login
User Email user_email
User URL user_url
Registration Date user_registered
User Status user_status
Display Name display_name
Roles roles
Usermeta field meta-zipcode (keys are prefixed with meta-)
BuddyPress field bp-123 (field IDs are prefixed with bp-)

Displaying users

To display a list of users, use WP_Query (not WP_User_Query) like so:

$args = array(
    'post_type' => 'upt_user',
    'post_status' => 'publish',
    'posts_per_page' => 10,
$query = new WP_Query( $args );

Displaying a subset of users

To display only administrators, select “Roles” in the settings page dropdown, then Sync. Afterwards, use the field within meta_query:

$args = array(
    'post_type' => 'upt_user',
    'meta_query' => array(
            'key' => 'roles',
            'value' => 'administrator',
            'compare' => '=',
$query = new WP_Query( $args );

Displaying user fields

UPT supports WP user functions; just replace $user_id with UPT()->get_user_id().

echo get_user_meta( UPT()->get_user_id(), 'your_field_name', true );

Outside of The Loop, pass in the post ID like so:

echo get_user_meta( UPT()->get_user_id( THE_POST_ID ), 'your_field_name', true );

Adding facets

When adding a new facet via Settings > FacetWP, you’ll see a new “User Fields” section in the Data source dropdown.

Developer Hooks

Prevent a specific user from being synced:

add_filter( 'upt_sync_skip_user', function( $bool, $user_id ) {
    if ( 1 === $user_id ) {
        return true;
    return $bool;
}, 10, 2 );

Force the admin menu to appear:

add_filter( 'upt_post_type_args', function( $args ) {
    $args['show_in_menu'] = true;
    return $args;

Perform some post-sync actions:

add_action( 'upt_sync_post', function( $post_id, $user_id ) {
​    // do something after a user is synced
​}, 10, 2 );



  • Fixed PHP notice when BuddyPress field is empty (props Jana M.)


  • Fix sync issue when upt_user posts are deleted (props Aldo Bombelli)


  • Added support for FacetWP’s built-in layout builder


  • Fixed typo that was causing Sync issues


  • Added support for BuddyPress
  • Bumped minimum requirement to PHP 5.4


  • If a user is skipped, remove its associated post item (props Aldo Bombelli)


  • Fixed deleting UPT post when a user is deleted (props Ben Carr)


  • Store the user_registered date in post_date_gmt to prevent timezone issues (props Ben Carr)


  • Added support for ACF fields