Phase space matching between two plasma-based accelerator (PBA) stages and between a PBA and a traditional accelerator component is a critical issue for emittance preservation. The drastic differences of the transverse focusing strengths as the beam propagates between stages and components may lead to a catastrophic emittance growth even when there is a small energy spread. We propose using the linear focusing forces from nonlinear wakes in longitudinally tailored plasma density profiles to control phase space matching between sections with negligible emittance growth. Several profiles are considered and theoretical analysis and particle-in-cell simulations show how these structures may work in four different scenarios. Good agreement between theory and simulation is obtained, and it is found that the adiabatic approximation misses important physics even for long profiles.