We present a method for direct three-dimensional (3D) patterning of porous nanomaterials through the application of a premastered and reusable gray-scale stamp. Four classes of 3D nanostructures are demonstrated for the first time in porous media: gradient profiles, digital patterns, curves and lens shapes, and sharp features including v-grooves, nano-pits, and ‘cookie-cutter’ particles. Further, we demonstrate this technique enables morphological tuning and direct tailoring of nanomaterial properties, including porosity, average pore size, dielectric constant, and plasmonic response. This work opens a rapid and low-cost route for fabricating novel nanostructures and devices utilizing porous nanomaterials, with promising applications spanning diffractive and plasmonic sensing, holography, micro- and transformation optics, and drug delivery and imaging.