The output voltage of microbial fuel cells (MFCs) needs to be controlled effectively to improve the operating efficiency of MFC system against the load variations, disturbances, and uncertainties. The output voltage control is purposed to provide the MFC with an appropriate amount of fuel required to maintain the stability of output voltage. In the applications, the MFC output voltage can be requested to track the variable reference voltage or to track the constant output voltage under changing conditions such as load change. For this purpose, two adaptive fuzzy PID (FPID) controllers powered by optimization algorithms were designed in this study to keep the output voltage value of the MFC at the desired values. This study extends the previous works by using optimization algorithms, such as particle swarm optimization (PSO) and gray wolf optimization (GWO) algorithms, to adjust fuzzy logic parameters, which are used for tuning Proportional‐Integral‐Derivative (PID) controllers. The optimization‐based adaptive FPID controllers play an active role in efficient, fast, and robust tracking of the reference voltage value with its adaptive structure. The designed adaptive control algorithms were tested under different cases, which involve the variation of the reference voltage and load conditions. The results show that both of these controllers can effectively control the output voltage of a MFC by regulating the flow rate of the fuel. In addition, the performances of the designed controller strategies according to the results obtained vary according to the reference signal. While PSO‐based FPID gives more successful results for positive step changes, GWO‐based FPID gives more successful results for negative step changes. These two control strategies show more efficient, robust, successful, and faster performances compared to the traditional PID controller.