Armchair WS2 nanoribbons are semiconductors with band gaps close to 0.5 eV. If some of the W atoms in the ribbon are replaced by transition metals, the impurity states can tremendously affect the overall electronic structure of the doped ribbon. By using first-principles calculations based on density functional theory, we investigated substitutional doping of Ti, V, Cr, Mn, Fe, and Co at various positions on WS2 ribbons of different widths. We found that Fe-doped ribbons can have two-channel conduction in the middle segment of the ribbon and at the edges, carrying opposite spins separately. Many Co-doped ribbons are transformed into spin filters that exhibit 100% spin-polarized conduction. These results will be useful for spintronics and nanoelectronic circuit design.