The preparation of materials with aligned porosity in the micrometre range is of technological importance for a wide range of applications in organic electronics, microfluidics, molecular filtration and biomaterials. Here, we demonstrate a generic method for the preparation of aligned materials using polymers, nanoparticles or mixtures of these components as building blocks. Directional freezing is used to align the structural elements, either in the form of three-dimensional porous structures or as two-dimensional oriented surface patterns. This simple technique can be used to generate a diverse array of complex structures such as polymer-inorganic nanocomposites, aligned gold microwires and microwire networks, porous composite microfibres and biaxially aligned composite networks. The process does not involve any chemical reaction, thus avoiding potential complications associated with by-products or purification procedures.