Long-time averages of outputs from chaotic dynamical systems exhibit high-frequency oscillations in parameter space, which makes gradient-based optimization impractical. We show that these oscillations can be eliminated by coupling the initial and final states of the trajectory to produce discontinuous periodic orbits (DPOs). This approach can be regarded as a generalization of (continuous) unstable periodic orbits, which have been shown to regularize time-averages from chaotic problems. To solve the DPO governing equations, we present a Newton–Krylov algorithm that is globalized using a line search and parameter continuation. We study the accuracy of DPO-based outputs using the Lorenz dynamical system and the Kuramoto–Sivashinsky partial differential equation, and we demonstrate the effectiveness of DPO-based optimization on two simple examples. We conclude the paper with a discussion of open questions for future research.