Freeze-thaw and dry-wet cycles are common phenomena in temperate regions. Such events may have a significant influence on the functioning of the soil microbial community. Using non-targeted metabolomics, we compared the effects of a single freeze-thaw or dry-wet event on microbial metabolism in an agricultural soil with and without plants. We showed that a dry-wet cycle had a greater impact on solute and metabolite concentrations in the unplanted soil than a freeze-thaw cycle. Drying or freezing caused increases in dissolved organic C, sugars and polyols, suggesting enhanced microbial production to alleviate temperature or moisture stress. Increased nucleobase concentration in the unplanted soil after a dry-wet cycle, and increased amino acids following both stresses, suggested a breakdown of microbial DNA and proteins released from damaged cells. The impacts of stress on metabolites in the planted soil were less than in the unplanted soil. In conclusion, our findings indicate that the soil microbial community responds quickly to stress events by accumulating osmotic solutes (e.g. sugars and polyols) and that a freeze-thaw event causes less disruption than dry-rewetting, and that plants have a key role in the mitigation of the freezing or drying effects on soil microbial communities.