Despite that evolutionary and swarm intelligence algorithms have achieved considerable success on multi-objective optimization problems, they face huge challenges when dealing with many-objective optimization problems (MaOPs). There is an urgent call for effective evolutionary and swarm intelligence algorithms for MaOPs. Inspired by the satisfactory performance of bacterial foraging optimization (BFO) on the single-objective optimization problems, this paper extends BFO to deal with MaOPs and proposes a knowledge guided BFO for MaOPs (called as KLBFO). Firstly, KLBFO learns promising direction knowledge based on group decision making idea to guide the population to converge toward proper directions. Secondly, KLBFO learns elite knowledge by a new biological mechanism to accelerate the population to converge. Thirdly, KLBFO learns density knowledge by a new diversity management strategy based on orthogonal grid to produce well-distributed solutions. The performance of KLBFO is comprehensively evaluated by comparing it with eight state-of-the-art algorithms on two suites of test problems and one real-world problem. The empirical results have validated the superior performance of KLBFO for MaOPs.