In this study, multi-story structures are actively controlled using metaheuristic algorithms. The soil conditions such as dense, normal and soft soil are considered under near-fault ground motions consisting of two types of impulsive motions called directivity effect (fault normal component) and the flint step (fault parallel component). In the active tendon-controlled structure, Proportional-Integral-Derivative (PID) type controller optimized by the proposed algorithms was used to achieve a control signal and to produce a corresponding control force. As the novelty of the study, the parameters of PID controller were determined by different metaheuristic algorithms to find the best one for seismic structures. These algorithms are flower pollination algorithm (FPA), teaching learning based optimization (TLBO) and Jaya Algorithm (JA). Furthermore, since the influence of time delay on the structural responses is an important issue for active control systems, it should be considered in the optimization process and time domain analyses. The proposed method was applied for a 15-story structural model and the feasible results were found by limiting the maximum control force for the near-fault records defined in FEMA P-695. Finally, it was determined that the active control using metaheuristic algorithms optimally reduced the structural responses and can be applied for the buildings with the soil-structure interaction (SSI).