Abstract A modular design optimization method for acoustic metamaterial cells is proposed, which can ensure satisfying the targeted noise attenuation by using only the objective function of an arbitrary noise source and the constraints of the application at hand. The core algorithm is a fusion of the generalized particle swarm algorithm and wave finite element method specialized for structural and targeted optimization of metamaterials. The output is the optimized metamaterial cell and its sound barrier structure. The desired noise reduction performance is verified via acoustic testing of a 3D‐printed prototype. The simulation and experimental results of test cases show that the designed acoustic metamaterial can perfectly block the target noise band and have significant advantages in terms of design efficiency, light weight, and noise attenuation.