BackgroundIn recent years, the issue of problematic Internet pornography use (PIPU) among adolescents has become increasingly prominent, attracting widespread attention from society. Family functioning has been recognized as a protective factor for PIPU, but the underlying mediating and moderating mechanisms remain unclear. The purpose of this study is (a) to investigate the mediating role of self-esteem in the relationship between family functioning and PIPU, and (b) to examine the moderating role of the need to belong in this mediating pathway.MethodsA total of 771 high school students (Mage= 16.19,SD= 0.90) were surveyed using the Problematic Internet Pornography Use Scale, Family Assessment Device, Rosenberg Self-Esteem Scale, and the Need to Belong Scale.ResultsCorrelation analysis showed a significant negative correlation between family functioning and PIPU (r= −0.25,p< 0.001), a significant positive correlation between self-esteem and family functioning (r= 0.38,p< 0.001), a significant negative correlation between self-esteem and PIPU (r= −0.24,p< 0.001), and a significant positive correlation between need to belong and PIPU (r= 0.16,p< 0.01). Mediation analysis showed that self-esteem partially mediated the relationship between family functioning and PIPU, with a mediation effect of −0.06. Further moderated mediation analysis showed that for adolescents with higher need to belong, the mediating effect of self-esteem was stronger.ConclusionsFor adolescents with high belonging needs who are at high risk for PIPU, good family functioning may have a protective effect by boosting self-esteem.