Metamaterials are fascinating tools that can structure not only surface plasmons and electromagnetic waves but also electromagnetic vacuum fluctuations. The possibility of shaping the quantum vacuum is a powerful concept that ultimately allows engineering the interaction between macroscopic surfaces and quantum emitters such as atoms, molecules or quantum dots. The long-range atom-surface interaction, known as Casimir-Polder interaction, is of fundamental importance in quantum electrodynamics but also attracts a significant interest for platforms that interface atoms with nanophotonic devices. Here we perform a spectroscopic selective reflection measurement of the Casimir-Polder interaction between a Cs(6P_{3/2}) atom and a nanostructured metallic planar metamaterial. We show that by engineering the near-field plasmonic resonances of the metamaterial, we can successfully tune the Casimir-Polder interaction, demonstrating both a strong enhancement and reduction with respect to its non-resonant value. We also show an enhancement of the atomic spontaneous emission rate due to its coupling with the evanescent modes of the nanostructure. Probing excited state atoms next to nontrivial tailored surfaces is a rigorous test of quantum electrodynamics. Engineering Casimir-Polder interactions represents a significant step towards atom trapping in the extreme near field, possibly without the use of external fields.