In this work, we report the design of topological filter and all-optical logic gates based on two-dimensional photonic crystals with robust edge states. All major logic gates, including OR, AND, NOT, NOR, XOR, XNOR, and NAND, are suitably designed by using the linear interference approach. Moreover, numerical simulations show that our designed all-optical logic devices can always work well even if significant disorders exist. It is expected that such robust and compact logic devices have potential applications in future photonic integrated circuits.