Yes, you can generally use cooking oil instead of butter in some cake recipes. However, there are a few things to keep in mind when making this substitution:
Choose the right oil: Some oils, such as canola oil or vegetable oil, are better substitutes for butter in cake recipes because they have a mild flavor and a neutral taste. Other oils, such as olive oil or coconut oil, may have a strong flavor that could affect the taste of the cake.
Measure the oil correctly: When substituting oil for butter, use a 1:1 ratio. So if the recipe calls for 1 cup of butter, use 1 cup of oil instead. Make sure to measure the oil accurately using a measuring cup or scale.
Adjust the recipe if needed: Butter is about 80% fat and 20% water, while oil is 100% fat. This means that if you use oil instead of butter, the cake may turn out slightly more moist or dense. To avoid this, you can reduce the amount of oil slightly or add a tablespoon or two of flour to the recipe.
Be aware of the taste and texture: Using oil instead of butter may affect the taste and texture of the cake. The cake may be more moist and have a slightly different flavor. If you are trying a new recipe, it's a good idea to make a small batch first to see how it turns out before making a larger batch.