Simple User Listing
[resolved] include / exclude (6 posts)

  1. fencer019
    Posted 2 years ago #

    Is it possible to add a parameter to include or exclude certain users?


  2. helgatheviking
    Plugin Author

    Posted 2 years ago #

    In the shortcode? At this moment, no. But you can always filter either sul_user_query_args or pre_user_query. I will consider adding support for the WP_User_Query parameters... it shouldn't be overly hard.

  3. creamille
    Posted 2 years ago #


    Since I'm not a web developper, I don't really know if it's correct, but it worked for me.

    I had a list of registered users (mainly contributors, but also 3 admins including me) and I didn't want to appear in this list. So the only solution for me was to only exclude my profile (ID), not a type of users.

    In the simple-user-listing.php l.137, I added :

    'exclude' => array( 1 ),

    $args = array(
    				'query_id' => 'simple_user_listing',
    				'exclude' => array( 1 ),
    				'offset' => $offset,
    				'number' => $number,
    				'orderby' => $orderby,
    				'order' => $order,
    				'role' => $role

    I was the first user registered ("1") but you could easily replace this ID by finding yours in your SQL file.
    It seems to work pretty well, so maybe it could help...

  4. helgatheviking
    Plugin Author

    Posted 2 years ago #

    Please don't hard-code something like that in the plugin source, you'll lose your changes as soon as you upgrade.

    [userlist exclude="1"]

    will work in the next update... which I will try to push out in a few days.

  5. creamille
    Posted 2 years ago #

    Ok, my bad! I need this feature to work now, so I leave it like this for now and when the next update is available, I will use this shortcode. Thanks for your prompt answer :)

  6. helgatheviking
    Plugin Author

    Posted 2 years ago #

    I just pushed it live, so check for updates in your dashboard.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple User Listing
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.