Comparison Operators PRO
Users Anywhere also allows you to use different comparison operators to filter your users by.
Negative Values
To apply a negative filter that excludes certain users, you can add !
before the value.
So this will show all users that are not in the Manager user group:
{users usergroup="!Manager"}...{/users}
You can also apply a negative filter with multiple values, separating them with a comma:
{users usergroup="!Manager,!Publisher"}...{/users}
If inside an attribute you want one condition to be true, but not the other, make sure you use the &&
separator between the values, which makes sure both conditions are true at the same time.
For example, the following will show all users that are Managers BUT are NOT Publishers:
{users tags="Manager && !Publisher"}...{/users}
Greater or Less than…
You can apply comparison filters on numeric and date values, by prepending the value with <,
<=
, >
or >=
.
For example, if you want to show all users that have the nr-of-legs
custom field value equal or greater than 2
:
{users nr-of-legs=">=2"}...{/users}
Or to show all users that have a lastvisit-date
date equal or greater than July 16, 2025:
{users lastvisit-date=">=2025-07-16"}...{/users}
You can also compare dates to the current date using Relative Dates or the now()
value.
Wildcards PRO
You can use the *
wildcard to match users, categories, tags, custom fields or other filters by only a part of the value.
The following syntax will return all users that have a name starting with "Peter":
{users name="Peter*"}...{/users}
The following syntax will return all users that have a name containing " van ":
{users title="* van *"}...{/users}
The following syntax will return all users in user groups that have a user group name ending in "Staff":
{users usergroup="*Staff"}...{/users}
Empty Values PRO
Output Users with Empty Values
You can also filter down to users where a certain field value doesn't exist (meaning it's empty or null).
To do so, simply leave the filter value (between quotes) empty.
The following syntax will return all users that don't have a value set for the custom field nr-of-legs
:
{users nr-of-legs=""}...{/users}
Exclude Users with Empty Values
Viceversa, you can filter down to users where a certain field value DOES exist (meaning it's NOT empty or null), no matter what the value is.
To tell the filter to show the users where a value is not empty, use *
as the value.
For instance, this will show all users that have a value for the nr-of-legs:
{users nr-of-legs="*"}...{/users}
Dynamic Values PRO
As we seen so far, you can filter users by specific values. However, you can also use dynamic values!
Same Values as Current User
If you want to get all users that have the same value of a certain data as the current logged in user, you can give the current
value to your desired filter.
For instance, to get the users that are in the same user group as the current user, you can simply use: usergroup="current"
. Or to get the contacts living in the same country as the current user, use contact:country="current"
. Even Custom Fields values are supported (my-custom-field="current"
).
Vice versa, to exclude the current user from the results, you can add id="!current"
to the plugin tag.
Data from Current User
Data from the user that is currently logged in is available to be used inside any Filter, for example by utilizing the user:id
value.
This is particularly useful to return a dynamic list of users that changes based on the user that is currently browsing the website and viewing that page:
{users my-custom-field="user:id"}...{/users}
You can also use other user data or custom fields:
{users my-custom-field="user:alias"}...{/users}
The user:...
values available are explained more in detail in the Current User Data List.
Relative Dates
You can use Relative Dates and Custom Formats inside Filters and If Structures.
This allows to return users that have a dynamic date value of the current day, yesterday, tomorrow, or any other date relative to today. All Relative Dates can also be combined and used with Comparison Operators or Date Ranges.
For example, to return a dynamic list of users that have a call-back date (custom field) of yesterday:
{users call-back-date="date('yesterday')"}...{/users}
To show all users that have a call-back date in the future:
{users call-back-date=">date('today')"}...{/users}
Or using a Date Range to output the users that logged in in the last 30 days:
{users lastvisit-date="date('-30 days') to now()"}...{/users}
Below you find some more examples of the type of values you can use:
now()
ordate()
ordate('now')
=> return current date and time (2025-07-15 22:49:43)
date('today')
=> return current date (2025-07-15)
date('tomorrow')
=> return date of tomorrow (2025-07-16)
date('yesterday')
=> return date of yesterday (2025-07-14)
date('-1 day')
=> return date of yesterday with current time (2025-07-14 22:49:43)
date('+2 days')
=> return date of 2 days from now with current time (2025-07-17 22:49:43)
date('-1 week')
=> return date from 1 week ago with current time (2025-07-08 22:49:43)
date('-1 month')
=> return date from 1 month ago with current time (2025-06-15 22:49:43)
date('-1 year')
=> return date from 1 year ago with current time (2024-07-15 22:49:43)
See the full list of the possible Relative Date Values that can be used.
For any relative date value, you can also customize the date format it should use. Here are some examples:
date('today', 'l')
=> return today's week day name (Tuesday)date('today', 'F')
=> return current month's name (July)date('today', 'Y')
=> return current year (2025)
date('tomorrow', 'Y-m-d H:i:s')
=> return date of tomorrow with time 00:00:00 (2025-07-16 00:00:00)
date('yesterday', 'Y-m-d H:i:s')
=> return date of yesterday with time 00:00:00 (2025-07-14 00:00:00)
date('-1 day', 'Y-m-d')
=> return date of yesterday (2025-07-14)
date('+2 days', 'Y-m-d')
=> return date of 2 days from now (2025-07-17)
date('-1 week', 'Y-m-d')
=> return date from 1 week ago (2025-07-08)
date('-1 month', 'Y-m')
=> return last month in Y-m format (2025-06)date('-1 year', 'Y')
=> return last year (2024)
The date format characters that you can use are based on the PHP date function.
Note: All Date Filters will be adjusted correctly according to the Time Zone used on your website.
Input Values
Users Anywhere can also dynamically access data from URL params (query strings) and form inputs, thanks to a special "input:.."
value.
This allows you to change which users are displayed on your page based on the data sent by a form (both GET and POST form requests are supported), or based on a custom parameter added to the URL.
For example, let's use a custom parameter called myparam
(but it can be anything you want):
{users usergroup="input:myparam"}...{/users}
With this plugin code, you could then customize the category from which the users are returned, by simply passing a parameter in the URL like:
https://www.mysite.com/my-users?myparam=Customers
You are also able to set a default value to be used in case the specified parameter is not passed, by adding after the parameter name separated by a colon. For instance, to show users from the user group "Registered" by default, unless overruled via your ?myparam=...
parameter:
{users usergroup="input:myparam:Registered"}...{/users}
Note: Be careful to not make it possible for people to show details of your users by simply changing the url parameters. So don't use this when showing email addresses of users by user groups for instance.
Note: If you're using Joomla cache (via Global Configuration, not via the System Plugin), you will need to register these additional URL Parameters as "safe", in order to make Joomla create a unique cache for each page. Users Anywhere allows you to do this in the "Advanced" tab of the plugin settings (for each extra parameter name, you should also specify what type of value it can be).
Multiple Groups PRO
In some cases, you don't want filters to narrow the result down, but to extend it. You can group different filters by separating the groups with ||
.
For instance, you might want to show all users from the "Customers" user group, plus all Registered users that have "Lifetime" in the custom "subscription" field.
{users usergroup="Customer" || usergroup="Registered" subscription="Lifetime"}...{/users}
You can use multiple filters per group.
Note that any Filters will be applied to each individual group, so they can be different for each group. However, any Output Settings (like ordering
, limit
and per-page
) will be applied to the whole tag.
So, for example (new lines are just for clarity):
{users
usergroup="Customer"
|| usergroup="Registered" subscription="Lifetime"
|| name="Peter"
limit="10" ordering="title"}
...
{/users}
This tag will return only 10 users in total in alphabetical order, from:
- the users in the "Customer" user group
- the Registered users with a Lifetime subscription
- the users that are called Peter