In this work, an all-optical 10-channel demultiplexer with ultra-narrow bandwidth filters using resonant cavities in a square 2D photonic crystal is designed and simulated. The rods of the proposed structure were selected as silicon materials with a refractive index of n = 1.4 in the air bed with a filling ratio of r = 0.1933a. The lattice index of the proposed structure is a = 600 nm. To provide a good percentage of passage from the input waveguide to the resonant cavities, point and linear defects, change the radius of the resonant cavities and adjust the distance of the dielectric rods around the cavity, are used. A power reflector is used to reduce losses in the proposed structure, which will occur by closing the input waveguide path of the reflection operation. Resonant cavities perform the main wavelength selection operation. The percentage of transmission power in the proposed structure is 100% at best and 90% at worst. The quality factor is between 2818 and 6381 at best and worst. The minimum average bandwidth of the output signal is 0.27 nm. The crosstalk between the output channels is between - 10 and - 48 dB. The overall dimensions of the proposed structure are 239.76 mu m(2). According to the simulation results, the proposed structure has suitable crosstalk, higher accuracy, and smaller dimensions than other similar structures, which are finally compared.