By Ross Ozarka
To only render shadows and not other elements in your scene…
1. Select your ground plane and go to Object Properties. Twirl down “Visibility,” and then check “Shadow Catcher.”
2. Select the objects you want to cast shadows but not render, and in the same visibility menu, under in “Ray Visibility” uncheck “Camera.”
3. In the Render Properties, twirl down “Film” and then check the “Transparent” checkbox. (this renders the background as transparent.)
Boom. Rendering only shadows.