The question of optimal spanwise-periodic modification for the stabilisation of spanwiseinvariant flows is addressed. A second-order sensitivity analysis is conducted for the linear temporal stability of parallel flows U 0 subject to small-amplitude spanwise-periodic modification ǫU 1 , ǫ ≪ 1. It is known that spanwise-periodic flow modifications have a quadratic effect on stability properties, i.e. the first-order eigenvalue variation is zero, hence the need for a second-order analysis. A second-order sensitivity operator is computed from a one-dimensional calculation, which allows one to predict how eigenvalues are affected by any flow modification U 1 , without actually solving for modified eigenvalues and eigenmodes. Comparisons with full two-dimensional stability calculations in a plane channel flow and in a mixing layer show excellent agreement.Next, optimisation is performed on the second-order sensitivity operator: for each eigenmode streamwise wavenumber α 0 and base flow modification spanwise wavenumber β, the most stabilising/destabilising profiles U 1 are computed, together with lower/upper bounds for the variation in leading eigenvalue. These bounds increase like β −2 as β goes to zero, thus yielding a large stabilising potential. However, three-dimensional modes with wavenumbers β 0 = ±β, ±β/2 are destabilised, and therefore larger control wavenumbers should be preferred. The most stabilising U 1 optimised for the most unstable streamwise wavenumber α 0,max has a stabilising effect on modes with other α 0 values too.Finally, the potential of transient growth to amplify perturbations and stabilise the flow is assessed with a combined optimisation. Assuming a separation of time-scales between the fast unstable mode and the slow transient evolution of the optimal perturbations, combined optimal perturbations that achieve the best balance between transient linear amplification and stabilisation of the nominal shear flow are determined. In the mixing layer with β 1.5, these combined optimal perturbations appear similar to transient growth-only optimal perturbations, and achieve a more efficient overall stabilisation than optimal spanwise-periodic and spanwise-invariant modifications computed for stabilisation only. These results are consistent with the efficiency of streak-based control strategies.