We propose a filter method to generate electron beams of high polarization from bubble and blow-out wakefield accelerators. The mechanism is based on the idea to identify all electron-beam subsets with low-polarization and to filter them out by an X-shaped slit placed right behind the plasma accelerator.To find these subsets we investigate the dependence between the initial azimuthal angle and the spin of single electrons during the trapping process. This dependence shows that transverse electron spins preserve their orientation during injection if they are initially aligned parallel or anti-parallel to the local magnetic field. We derive a precise correlation of the local beam polarization as a function of the coordinate and the electron phase angle. Three-dimensional particle-in-cell simulations, incorporating classical spin dynamics, show that the beam polarization can be increased from 35% to about 80% after spin filtering. The injected flux is strongly restricted to preserve the beam polarization, e.g. <1kA in Ref.[27]. This limitation is removed by employing the proposed filter mechanism. The robust of the method is discussed that contains drive beam fluctuations, jitters, the thickness of the filter and initial temperature.This idea marks an efficient and simple strategy to generate energetic polarized electron beams based on wakefield acceleration.