Return ID of authors who have at least one post
Instead of a JOIN, you can use a IN with a subquery, to prevent duplicate results because of the join: SELECT ID, display_name FROM wp_users WHERE ID IN (SELECT post_author FROM wp_posts) This will not look at capabilities. If you also want that you can add them like a join, but move the meta_key clause … Read more