This paper aims to evaluate the effects of compaction on the anaerobic biodegradability of straw. In the study, compaction tests were carried out at different applied pressures, i.e., 0 (CK), 277 (T1), 555 (T2), and 1109 Pa (T3), respectively. The changes in physicochemical indicators (i.e., pH, VFA, COD, and DHA) of the liquid digestate were monitored. Factor analysis was adopted to analyze biogas production's main factors in the bath Anaerobic digestion (AD) process. Changes in the surface structures and composition of solid digestate were analyzed. The results showed that the maximum gain in biogas production was 298.35mL·g− 1TS for the T2 reactor, significantly higher than that of CK and T3 reactors. The effect of compaction on the physicochemical index of liquid digestate was not significant during the batch-type AD process. The factor analysis results suggested that the major factors affecting biogas production were influenced by the compaction and varied based on the different stages of digestion. Scanning electron microscopy (SEM) showed that the straw surface was damaged as the compaction increases; however, the degree of damage was not significant. This research concluded that compaction on gas production via changing the environment during the bath AD process and proper compaction could positively affect biogas' yield, while excessive compaction will inhibit gas production.