Return all users that have one or more published blog posts

There is an argument for this, and it is documented. If you look at the documentation for get_users() is says this:

See WP_User_Query::prepare_query(). for more information on accepted arguments.

If you follow that link you’ll see the list of arguments, and one of those is:


(bool|array) Pass an array of post types to filter results to users who have published posts in those post types. true is an alias for all public post types.

So you can get published authors like this:

$authors = get_users( [ 'has_published_posts' => true ] );

Or, if you just want users who have published posts:

$authors = get_users(
        'has_published_posts' => [ 'post' ],