Some heralded schemes are presented for realizing solid-state quantum gates, including SWAP and √ SWAP gates. They are achieved by emitter-photon scattering in 1D waveguides, and the qubits are encoded on the degenerate ground states of the solid-state emitters. The schemes for these two quantum gates feature a filtering mechanism that the faulty scattering events between quantum emitters and photons can be mapped into the heralded photon losses. That is, the protocols can turn physical errors caused by system imperfections into the detection of photon polarization, which is advantageous for quantum information and quantum computation. Furthermore, no auxiliary solid-state qubits are needed in our schemes, which reduces not only quantum resource but also error. The calculations reveal that the success probabilities and fidelities of the two quantum gates are high with current experimental technologies.