The tracking of a predefined trajectory with less error, system-settling time, system, and overshoot is the main challenge with the robot-manipulator controller. In this regard, this paper introduces a new design for the robot-manipulator controller based on a recently developed algorithm named the butterfly optimization algorithm (BOA). The proposed BOA utilizes the neighboring butterflies’ co-operation by sharing their knowledge in order to tackle the issue of trapping at the local optima and enhance the global search. Furthermore, the BOA requires few adjustable parameters via other optimization algorithms for the optimal design of the robot-manipulator controller. The BOA is combined with a developed figure of demerit fitness function in order to improve the trajectory tracking, which is specified by the simultaneous minimization of the response steady-state error, settling time, and overshoot by the robot manipulator. Various test scenarios are created to confirm the performance of the BOA-based robot manipulator to track different trajectories, including linear and nonlinear manners. Besides, the proposed algorithm can provide a maximum overshoot and settling time of less than 1.8101% and 0.1138 s, respectively, for the robot’s response compared to other optimization algorithms in the literature. The results emphasize the capability of the BOA-based robot manipulator to provide the best performance compared to the other techniques.