Due to resource scarcity, energy crises and environmental pollution, optimization is very important nowadays. For this purpose, various optimization methods have been developed, which are also used in the field of structural design. In this study for the first time, an optimization algorithm based on biogeography with specialized structural objectives was developed and used to minimize the weight and cost of bending steel frames. By adapting the algorithm for use with steel frames, its accuracy and efficiency is increased. In addition, the time to reach the optimal solution was reduced since the search space of the problem has smaller dimensions due to the characteristics of the structure, so that not all variables are evaluated by the objective function; therefore the analysis and design time is reduced. On the other hand, there is a logical balance between the two important features: exploration and exploitation in the optimization process, reducing the computational efforts in the analysis and design of frames. To show the performance and efficiency of this algorithm, four two-dimensional steel frames with three, ten, fifteen and twenty-four stories is presented and the geometric and design constraints is applied according to LRFD-AISC. The developed algorithm selects the optimal W-sections for beams and columns of the frames from the list of 267 W-sections. The optimization codes are written in MATLAB and the SAP2000 software is connected to MATLAB for the analysis and design of steel frames. The results show that this algorithm can develop superior frame designs with low weight compared to other optimization methods and improves computational efficiency in solving structural optimization problems.