• HAP application (>2.5%) ensured safe wheat production in polluted alkaline soils. • HAP treatment reduced acid-soluble Cd/Zn/Cu, inhibiting their availability to wheat. • HAP increased Cu/Cd/Zn resistance and detoxification genes abundance. • HAP increased labile C degradation, N degradation and P activation genes abundance.