We report the results of a study on the dynamical compactification of spatially flat cosmological models in Einstein–Gauss–Bonnet gravity. The analysis was performed in the arbitrary dimension in order to be more general. We consider both vacuum and Λ -term cases. Our results suggest that for vacuum case, realistic compactification into the Kasner (power law) regime occurs with any number of dimensions (D), while the compactification into the exponential solution occurs only for D ⩾ 2 . For the Λ -term case only compactification into the exponential solution exists, and it only occurs for D ⩾ 2 as well. Our results, combined with the bounds on Gauss–Bonnet coupling and the Λ -term ( α , Λ , respectively) from other considerations, allow for the tightening of the existing constraints and forbid α < 0 .