This paper proposes an intelligent approach based on the empirical Fourier decomposition (EFD) to identify harmonic sources at the point of common coupling (PCC) when different inverter-based distributed generations (DGs) like microturbine (MT), battery energy storage system (BESS), photovoltaic (PV), superconducting magnetic energy storage (SMES), wind turbine with a permanent magnet synchronous generator (PMSG), and doubly-fed induction generator (DFIG) wind turbine are presented. In order to decrease memory storage and computational burden, strife feature selection is used. Applying just voltage signals consumes less processing time and decreases measurement devices. Moreover, the whale optimization algorithm (WOA) as the optimizer of the parameters of the support vector machine (SVM) classifier is used. Consequently, the results from the proposed method can be helpful for both engineers and researchers to plan and develop a better strategy to mitigate harmonic distortion.