Don't fret if you have a recipe that calls for shortening, but you don't have any or would prefer to avoid it. There are simple substitutes that are commonly used. Which fat you pick depends on which qualities of shortening are desired.
Why Recipes Call for Shortening Over Oils or Fats
Shortening is used in baking for short doughs—ones where a stretchy dough that forms gluten is not desired. If you want a flaky pie crust, you don't want the gluten forming in the dough or the crust won't have the right texture. The fat in shortening coats the flour and keeps water from activating the compounds that form gluten.
Before vegetable shortening was invented, lard was commonly used for this purpose in baking. Both lard and shortening are almost entirely fat, without water that would activate gluten formation. Another advantage of using shortening and lard in flaky, tender pie crust and baked goods is that, as solid fats, they don't mix as completely with the dry ingredients as oils do. This leaves streaks of solid fat in the dough that when they melt during baking, they produce that light and flaky result.
If you're using a swap to avoid the trans-fat in shortening, you might want to think again. Shortening got a bad reputation as it was high in trans-fatty acids. Manufacturers such as Crisco and Cookeen reformulated their products to reduce trans fats. Some recipes call for shortening just to grease a pan. In that case, you can substitute cooking spray or use oil, butter, or lard to grease the pan.
Swapping in Butter
Butter or margarine can be used instead, adding a couple of extra tablespoons per cup of shortening called for in a recipe. So for every 1 cup of shortening called for in a recipe, use 1 cup butter or margarine plus 2 tablespoons.
Butter has a lower melting point than shortening and might change the texture of your recipe slightly, making it more or less crisp, less flaky or less fluffy. The best approach is to experiment, and if possible, do a test run before making your dish for an important occasion like a holiday dinner. Note that butter generally shouldn't be used for deep frying but it works fine for greasing a pan.
Coconut oil can be substituted for butter and most other fats in equal measure. Since it's solid at room temperature, it can also be used as a spread, although it tastes very different from butter.
When using coconut oil in recipes, you can melt it or beat it with sugar just as you would with butter or shortening. It has become popular as a healthier alternative to butter since it has beneficial fats. Coconut oil can be a bit more expensive than butter, and if you're trying to reduce the fat in a recipe, coconut oil is not the way to go: it has as much or more fat than butter or shortening.
Lard is a perfectly acceptable substitute for shortening in most recipes. Know that lard is an animal product and if you want to eliminate animal fats from your diet, avoid lard. Deep-frying is fine with lard. It has a higher smoke point than butter and will spatter less because it contains less water.
Ask the doctor: Coconut oil and health. Harvard Health. https://www.health.harvard.edu/staying-healthy/coconut-oil#:~:text=Coconut%20oil%20is%20about%2090,even%20lard%20(also%2040%25). Published August 22, 2018.