Fractional order PID (FOPID) controllers are introduced as a general form of classical PID controllers using fractional calculus. As this controller provides good disturbance rejection and is robust against plant uncertainties it is appropriate for the vibration mitigation in structures. In this paper, an FOPID controller is designed to adjust the contact force of piezoelectric friction dampers for semi-active control of base-isolated structures during far-field and near-field earthquake excitations. A multi-objective cuckoo search algorithm is employed to tune the controller parameters. Considering the resulting Pareto optimal front, the best input for the FOPID controller is selected. For seven pairs of earthquakes and nine performance indices, the performance of the proposed controller is compared with those provided by several well-known control techniques. According to the simulation results, the proposed controller performs better than other controllers in terms of simultaneous reduction of the maximum base displacement and story acceleration for various types of earthquakes. Also, it provides acceptable responses in terms of inter-story drifts, root mean square of base displacements and floor acceleration. In addition, the evaluation of robustness for a stiffness uncertainty of ±10% indicates that the proposed controller gives a robust performance against such modeling errors.