Purpose. Discontinuities in rock masses are natural fractures that delimit various block shapes and sizes, which can fall, slide or topple from the excavation and collapse under their own weight inducing probably severe damage. Thus, it is essential to carry out a block analysis before beginning any surface or underground excavation project. This paper proposes a methodology based on key block theory analysis to select the suitable slope of different discontinuous rock masses of an open-pit mine in Morocco. Methods. At first, the main discontinuities of each bench are determined and projected onto a stereonet with a maximum dip angle of the excavation plane. Then, it is possible to identify the removable blocks by using the theorem of removability according to block theory. After that, a limit equilibrium analysis is performed to determine the failure mode and the friction angle required to stabilize the blocks. When the selected dip angle of the slope plane is found to be unsuitable, it is changed and reduced by one degree, and the same approach is repeated until the maximum safe slope dip angle is obtained. Findings. The results of the proposed methodology based on key block theory analysis have shown that the maximum safe slope angles of the studied benches are in the range of 63-73°. When compared to the slope angles used in the mine, which are between 58-78°, the results of this study are close to in-situ conditions. Originality. In this research, the maximum safe slope angle of fractured rock masses was optimized by eliminating slope angles inducing unstable blocks (key blocks) and by using the stereographic projection method of key block theory. Practical implications. Using this methodology, stability of rock slopes in civil or mining-engineering projects can be designed or assessed when geotechnical data are very limited.