Preheat oven to 350°F and grease an 8×8 baking pan or 9-inch round cake pan.
Cream butter and sugar in a large mixing bowl until light and fluffy.
Add eggs one at a time, mixing well after each addition. Stir in vanilla extract.
Mix in sourdough discard until fully incorporated.
In a separate bowl, whisk together flour, baking soda, baking powder, and salt.
Combine wet and dry ingredients, alternating the flour mixture with the milk. Mix gently until just combined.
Pour batter into prepared pan and smooth the top.
Bake for 30–35 minutes, or until a toothpick inserted into the center comes out clean.
Allow the cake to cool for 15–20 minutes before slicing or frosting.