Pleated membrane filters are ubiquitous in many industrial filtration systems due to their high surface-area-to-volume ratio. However, their performance often falls short compared to flat non-pleated membrane filters of the same membrane surface area. This raises the question: What is the optimal initial internal pore structure of the membrane to achieve the most efficient filtration? To address this question, we first present a mathematical model describing the feed flow and particle transport within the complex geometry of a pleated filter based on our previous work [Fong and Sanaei, “Flow and transport in a pleated filter,” Phys. Fluids 34, 097102 (2022)]. We then analyze the governing equations using asymptotic analysis by exploiting the small aspect ratios of the pleated membrane and filter cartridge. In the second part of the paper, we formulate a computationally efficient optimization problem aimed at determining the optimal initial pore shape to improve filtration performance. Depending on the initial average porosity, substantial differences in the computed optimal pore profile are observed. Furthermore, by varying a geometric parameter in our model, we investigate the influence of the pleat packing density on the optimal initial pore shape.