Recommender systems on online platforms are often accused of polarizing user attention and consumption. We examine this phenomenon using a quasi-experiment conducted by Zhihu, the largest online knowledge-sharing platform (or Q&A community) in China. Zhihu originally used a content-based filtering algorithm, which recommends content to users based on the topics to which each user has subscribed. After more than a year, Zhihu moved to a social filtering algorithm, which recommends content with which users’ social connections are already engaged. We find that this algorithm change increased the creation of social ties by approximately 15% but decreased question subscriptions (answer contributions) by 20% (23%). We show that users’ increased social interests mainly involved following popular users, leading to a greater concentration of social interests on the platform. However, we find that users’ topical interests became less concentrated, as popular topics received significantly fewer subscribers than unpopular topics. We explain these findings by exploring their underlying mechanism. We show that compared with content-based filtering algorithms, social filtering algorithms are more likely to expose general users to content consumed by their followees, who are more interested in niche topics than general users.