Constipation is a common functional gastrointestinal disorder which needs more effective treatment approaches. Houpo Paiqi Mixture (HPPQM) is a type of Chinese patent medicine developed from a classical formula that has been widely applied to the treatment of intestinal motility disorder. Here we aim to assess the effectiveness of HPPQM in the treatment of constipation in rat models and its potential mechanism. UPLC-MS/MS was performed to investigate the chemical component of HPPQM. Rats were randomly divided into normal control, constipation model (CM), HPPQM (low, middle and high dose) and mosapride groups. Loperamide 8mg/kg was given orally to induce constipation model. The small intestine motility, colonic contraction, rectum propulsion and histological feature of the colon were significantly improved in HPPQM group, compared with CM group (P<0.05). Results of 16S rRNA sequencing revealed that HPPQM treatment strikingly restructured intestinal microbiota in constipated rats by increasing the relative abundances of Bacteroides and Akkermansia and decreasing the relative abundances of Prevotella and Lactobacillus. The levels of GPR43, 5-HT, 5-HT4R, cAMP, PKA were decreased while SERT was increased in constipated rats (P<0.05), which could be restored to normal levels by treatment with HPPQM (P<0.05). Differences in amplitude between experimental CLSMs (with HPPQM added) and control CLSMs were discovered, starting at the concentration of 40 nL/mL (P<0.05). It was found that GLPG0974 and GR113808 could significantly reduce this reactivity (P<0.05). HPPQM manifested a curative effect in constipated rats by promoting intestinal motility. The underlying mechanisms might be related to modulating gut microbiota and activating 5-HT-cAMP-PKA signal pathway.