The microbunching instability seeded by small initial density modulation and driven by collective effects can cause significant electron beam quality degradation in next generation x-ray free electron lasers. A method exploiting longitudinal mixing derived from the natural transverse spread of the electron beam through a dispersive bending magnet was proposed to suppress this instability several years ago [Phys. Rev. Lett. 111, 054801 (2013)PRLTAO0031-900710.1103/PhysRevLett.111.054801]. Instead of using bending magnets to introduce the transverse-to-longitudinal coupling, which will lead to an inconvenient deflection of the downstream beam line, in this paper, we propose a scheme to mitigate the microbunching instability by inserting a quadrupole magnet inside a bunch compressor of the accelerator. This results in transverse-to-longitudinal phase space mixing and large slice energy spread that can efficiently mitigate the growth of the microbunching instability through the major accelerator section. Finally, at the exit of the accelerator, a dogleg section is used to restore the emittance and slice energy spread before entering the undulator radiation section. Multiparticle simulations show that the transverse space charge, structure wakefield, and the coherent synchrotron radiation effects will have a relatively small impact on this scheme.