We theoretically demonstrate that Al(Ga)N nanorod arrays (NRAs) exhibit tunable absorption and achieve selective resonant absorption according to different Al mole factions based on COMSOL Multiphysics via the three‐dimensional finite‐element method. The optical properties of AlxGa1‐xN (x = 0, 0.2, 0.4) NRAs with different geometrical parameters were discussed from the optical absorption and electric field distribution diagram perspective. The simulated results show that the resonant wavelength of absorption spectra is red‐shifted with increase of diameter. Besides, the NRA with diameter ≤ 70 nm own lower absorptance compared to the NRA with larger diameter, which is attributed to the weak coupling between light and NRs. In terms of the influences of pitch on the optical properties, intense coupling between incident light and NRAs with smaller pitch can be obtained. Notably, the position of absorption peak is blue‐shifted as the aluminum (Al) component increases. This work is promising for photovoltaics and photodetection in ultraviolet field.