In the present study, the experimental design method was used to optimize the preparation conditions of an activated carbon from prickly pear seed cake by phosphoric acid activation. The parameters studied include impregnation ratio, carbonization temperature, and carbonization time. The optimal conditions for the preparation of the activated carbon with high adsorption capacity for methylene blue were identified to be an impregnation ratio of 2.9, carbonization temperature of 541°C, and carbonization time of 88 min. The obtained activated carbon was characterized by SEM/EDX, FTIR, pHpzc, and its capacity to adsorb methylene blue. FTIR analysis and pHPZC showed the acidic character of the activated carbon surface. The adsorption capacity of the optimal activated carbon was found to be 260 mg·g−1 for methylene blue. The adsorption equilibrium of methylene blue was well explained by the pseudo-second-order model and Freundlich isotherm. Furthermore, the performance of the produced activated carbon was examined by the methyl orange removal.