We derive a nonlinear equation governing dynamics of short-wavelength longitudinal waves in ultrarelativistic electron–positron–ion plasmas. In contrast to the recent work by Lashkin [Phys. Plasmas 27, 102302 (2020)], where a similar equation was suggested in the framework of the Wigner function approach for a nonrelativistic electron–ion degenerate plasma, in our case which is based on the Vlasov kinetic equation, all three species of particles (electrons, positrons, and ions) should be present. The nonlinearity arises only in the presence of a population of ions. By numerical simulations, we demonstrate that collisions between even four solitons are fully elastic.