During the pandemic era, quarantines might potentially have negative effects and disproportionately exacerbate health condition problems. We conducted this cross-sectional, national study to ascertain the prevalence of constant pain symptoms and how quarantines impacted the pain symptoms and identify the factors associated with constant pain to further guide reducing the prevalence of chronic pain for vulnerable people under the pandemic. The sociodemographic data, quarantine conditions, mental health situations and pain symptoms of the general population were collected. After adjusting for potential confounders, long-term quarantine (≥15 days) exposures were associated with an increased risk of constant pain complaints compared to those not under a quarantine (Odds Ratio (OR): 1.26; 95% Confidence Interval (CI): 1.03, 1.54; p = 0.026). Risk factors including unemployment (OR: 1.55), chronic disease history (OR: 2.38) and infection with COVID-19 (OR: 2.15), and any of mental health symptoms including depression, anxiety, insomnia and PTSD (OR: 5.44) were identified by a multivariable logistic regression. Additionally, mediation analysis revealed that the effects of the quarantine duration on pain symptoms were mediated by mental health symptoms (indirect effects: 0.075, p < 0.001). These results advocated that long-term quarantine measures were associated with an increased risk of experiencing pain, especially for vulnerable groups with COVID-19 infection and with mental health symptoms. The findings also suggest that reducing mental distress during the pandemic might contribute to reducing the burden of pain symptoms and prioritizing interventions for those experiencing a long-term quarantine.