Graphene nanomeshes (GNMs), formed by creating a superlattice of pores in graphene, possess rich physical and chemical properties. Many of these properties are determined by the pore geometry. In this work, we use first principles calculations to study the magnetic and electronic properties of metal-doped nitrogen-passivated GNMs. We find that the magnetic behaviour is dependent on the pore shape (trigonal versus hexagonal) as dictated by the number of covalent bonds formed between the 3d metal and the passivating N atoms. We also find that Cr and V doped trigonal-pore GNMs, and Ti doped GNMs are the most favourable for spintronic applications. The calculated magnetic properties of Fe-doped GNMs compare well with recent experimental observations. The studied systems are useful as spin filters and chemical sensors.