Witness beam stability and preservation of its ultra-low emittance have been identified as critical challenges toward realizing a TeV-class, plasma-based linear collider. In fact, the witness bunch parameters required by a future TeV-class collider have been expected to trigger hosing instability and background ion motion, leading to emittance degradation and, potentially, to bunch loss. Recently, it has been shown that ion motion suppresses the hosing instability, and proper longitudinal bunch shaping can eliminate the ion-motion-induced emittance growth. In this paper, we propose and analyze a plasma-based method to generate the shaped bunches that enable emittance preservation in the presence of ion motion. The method is based on an adiabatic matching procedure, where a bunch with an initially untapered profile is injected in the plasma accelerator stage with an energy low enough that ion motion effects are initially small. As the bunch accelerates, it is adiabatically compressed, ion motion is gradually triggered, and the bunch slowly but continuously readjusts itself in the ion motion-perturbed wakefield acquiring the desired taper. The production of tapered witness bunch profiles that minimize energy spread and preserve emittance for collider-relevant parameters could enable the use of plasma-based accelerators for high-energy physics applications.