CP-violating contributions to Higgs-fermion couplings are absent in the standard model of particle physics (SM), but are motivated by models of electroweak baryogenesis. Here, we employ the framework of the SM effective theory (SMEFT) to parameterise deviations from SM Yukawa couplings. We present the leading contributions of the relevant operators to the fermionic electric dipole moments (EDMs). We obtain constraints on the SMEFT Wilson coefficients from the combination of LHC data and experimental bounds on the electron, neutron, and mercury EDMs. We perform, for the first time, a combined fit to LHC and EDM data allowing the presence of CP-violating contributions from several fermion species simultaneously. Among other results, we find non-trivial correlations between EDM and LHC constraints even in the multi-parameter scans, for instance, when floating the CP-even and CP-odd couplings to all third-generation fermions.