Abstract In this paper, the generalized (3+1)-dimensional variable-coefficient Kadomtsev–Petviashvili equation (VCKPE), which can describe nonlinear phenomena in fluids or plasmas, is studied by using two different Clarkson and Kruskal (CK) direct methods, namely, the classical CK and the modified enlarged CK method. A similarity reduction to a (2+1)-dimensional nonlinear partial differential equation and a direct similarity reduction to a nonlinear ordinary differential equation are obtained, respectively. By solving the reduced ordinary differential equation, new solitary, periodic, and singular solutions for the VCKPE are obtained. Some figures for the soliton and periodic wave solutions are given to reflect the effect of the variable coefficients on the solution propagation. Finally, the comparison between the two different CK techniques indicates that the modified enlarged CK technique is clearly more powerful and simple than the classical CK technique.