PurposeWith the rapid development of paid online social question and answer (Q&A) communities, monetary social functions have been introduced and have potential benefits for both platforms and users. However, these functions' impact on knowledge contribution remains uncertain. This study proposes a conceptual model based on the stimulus–organism–response framework, according to which monetary and non-monetary social functions can help nurture short-term and long-term relationships among community users, and thereafter improves social identity and knowledge-sharing intentions.Design/methodology/approachThis study selects Zhihu, a famous online social Q&A community in China, and conducts an online survey to collect data from its frequent users. A sample of 286 valid questionnaires was collected to test our research model by using a structural equation modeling method. In addition, a bootstrapping approach is used to test the mediation effect.FindingsResults indicate that monetary social functions help nurture short-term and long-term relationships among community users. However, non-monetary social functions only affect short-term relationships directly. Short-term and long-term relationships both have a positive relationship with social identity and thereafter improve users' knowledge-sharing intentions.Originality/valueThis study focuses on users' knowledge-sharing intentions in Q&A communities from the perspective of social. Specifically, we separated social functions in Q&A platforms into monetary and non-monetary ones and explored their impact on the development of short-term and long-term relationships. Results demonstrate the importance of monetary social functions and explain how monetary and non-monetary social functions affect users' knowledge-sharing intentions in different approaches.