Photonic topological states are prospective in integrated optical devices due to their robustness to perturbations and defects. When taking into account the nonlinear effects of the system, the functionality of topological photonics can be further enhanced. Here, we investigated the interplay between topological edge states and nonlinear effects based on the Su–Schrieffer–Heeger (SSH) model. Relying on the theory prediction that topological edge states would shift upward under the action of nonlinearity, two types of optical switching are designed and experimentally realized in femtosecond laser direct-write waveguide arrays. This work provides a new, to the best of our knowledge, approach to preparing all-optical switches and offers a new perspective on the application of nonlinearity in topological optical devices.