wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query
I think you’re on the right track because wp_get_object_terms() can take an array of IDs for its first argument, it’s just that $wp_query is not the array you want. I can’t guarantee that this is more efficient (not my area of expertise), but I believe this [partially-tested] snippet would do what you want with at … Read more