Online shopping addiction is a growing behavioral problem among university students, driven by the rapid development of e-commerce platforms. This study constructs, analyzes, and applies optimal control to an SEIRS (susceptible--exposed--infected--recovered--susceptible) mathematical model of online shopping addiction dynamics among students of the Faculty of Mathematics and Natural Sciences, Universitas Negeri Makassar. The population is divided into susceptible, exposed, addicted, and recovered compartments, and the model incorporates the possibility of relapse from the recovered to the susceptible compartment. The analysis determines the addiction-free and endemic equilibria, examines local stability through Jacobian linearization, and computes the basic reproduction number using the next-generation matrix method. Optimal control is formulated using Pontryagin's minimum principle, with an educational and counseling intervention as the control applied to the addicted compartment. Primary data were obtained from questionnaires distributed to ninety-eight active students, and numerical simulations were carried out using the fourth-order Runge--Kutta and forward--backward sweep methods in Python. The basic reproduction number is approximately 1.03, which is greater than one, indicating that online shopping addiction can persist and spread within the population; consistently, the addiction-free equilibrium is unstable and the endemic equilibrium is locally asymptotically stable. Applying the optimal control suppresses the peak addicted population by 43.1 percent, accelerates the movement of addicted individuals toward recovery during the intervention window, and preserves a substantially larger never-addicted susceptible population. These results demonstrate that educational intervention is mathematically effective in controlling the spread of online shopping addiction.