Spectral clustering and matrix factorization are two widely utilized algorithms for community detection. On the one hand, most existing spectral clustering algorithms focus on learning node representations from a well-designed similarity matrix that thoroughly incorporates data attribute information. However, they often overlook the intrinsic attribute information embedded within the algorithm itself. On the other hand, the node representations generated by most existing matrix factorization algorithms often exhibit a lack of linear independence, leading to the presence of redundant information. Motivated by them, we propose an algorithm, SOCD (Selective Orthogonalization for Community Detection), which leverages the orthogonality loss of the Lanczos algorithm to monitor whether eigenvalues converge or not, and saves the already converged eigenpairs, then the corresponding converged eigenvectors are employed for community structure detection. Meanwhile, the already converged eigenvectors continue to be orthogonalized against the Lanczos vector to preserve the orthogonality of the Lanczos algorithm. A large number of experiments conducted on real datasets with community labels demonstrate the superiority of our algorithm over its competitors. The experimental code is available for download at https://github.com/AnonSimRank/SOCD/.