Pineapple Pistachio Cake That Stays Moist for Days
This pineapple pistachio cake is loaded with crushed pineapple and chopped pistachios, topped with a tangy cream cheese frosting. It comes together quickly and stays soft for days, making it a reliable anytime dessert.

The pineapple keeps it tender, while the pistachios add a subtle crunch. The frosting is smooth and just sweet enough to balance the tropical cake.
Why This Cake Stays in My Rotation
Most cakes dry out by day two. This one holds onto its moisture because of the crushed pineapple and a bit of oil. The crumb stays springy and soft from the first slice to the last.
The flavor is bright and nutty, and that cream cheese frosting cuts through the richness without feeling heavy. It is the kind of cake you can make on a Tuesday evening and keep on the counter through the weekend.
Ingredients

- 2 cups all-purpose flour: spooned and leveled, so the cake is not dense
- 1 cup granulated sugar
- 1 tsp baking powder
- ½ tsp baking soda
- ¼ tsp salt
- 2 large eggs: at room temperature
- ½ cup vegetable oil: any neutral oil, like canola or sunflower
- 1 tsp vanilla extract
- ½ tsp almond extract: brings out the pistachio flavor
- 8 oz can crushed pineapple in juice: well drained, juice reserved for another use
- ½ cup shelled raw pistachios: roughly chopped, plus a small handful for topping
- 8 oz block cream cheese: full fat, softened
- ¼ cup unsalted butter: softened
- 2 cups powdered sugar
- 1 tsp vanilla extract: for the frosting
Variations / Substitutions
- Swap the nuts: chopped walnuts or almonds work well, but pistachios give the best color and mild nuttiness.
- Add coconut: fold ⅓ cup shredded sweetened coconut into the batter for extra tropical flavor.
- Make it gluten-free: use a 1:1 gluten-free flour blend that contains xanthan gum. The texture stays tender.
- Skip the almond extract: if you do not have it, use an extra ½ tsp vanilla or ¼ tsp pistachio extract instead.
- Go nut-free: simply leave out the pistachios. The cake will still be soft and full of pineapple flavor.
If you like tropical desserts, try my Coconut Lime Loaf.
How to Make Pineapple Pistachio Cake
Step 1: Whisk the Dry Ingredients

In a large bowl, whisk together the 2 cups flour, 1 cup sugar, 1 tsp baking powder, ½ tsp baking soda, and ¼ tsp salt until evenly combined.
This quick whisk aerates the flour and distributes the leavening, so you do not get any baking powder pockets in the finished cake.
Step 2: Beat the Wet Ingredients

In a separate bowl, beat the 2 eggs, ½ cup oil, 1 tsp vanilla, and ½ tsp almond extract until smooth and a little frothy, about 30 seconds. Stir in the drained crushed pineapple until it breaks into small flecks throughout the mixture.
Drain the pineapple really well before adding it. Press it gently in a fine-mesh strainer so you remove most of the juice. Too much liquid makes the cake heavy.
Step 3: Fold the Batter Together

Pour the wet mixture into the dry ingredients. Fold gently with a rubber spatula just until the flour disappears and you no longer see dry streaks. Fold in the ½ cup chopped pistachios.
Stop folding the moment everything is combined. Overmixing at this stage develops gluten and turns the cake tough, so a few small lumps are fine.
Step 4: Bake the Cake

Preheat the oven to 350°F (175°C). Grease a 9×13-inch baking pan. Scrape the batter into the pan and spread it evenly with the spatula. Bake for 30 to 35 minutes, until a toothpick inserted in the center comes out clean or with a few moist crumbs.
The cake will pull away slightly from the sides and the top will be evenly golden. Let it cool completely in the pan on a wire rack before frosting.
Step 5: Frost and Slice

Beat the 8 oz cream cheese and ¼ cup butter with an electric mixer on medium speed until smooth and creamy. Add the 2 cups powdered sugar and 1 tsp vanilla. Beat on low until incorporated, then increase to medium and beat for 1 minute until fluffy.
Spread the frosting over the cooled cake right to the edges. Scatter the reserved handful of chopped pistachios on top, then slice into squares and serve. The frosting stays soft and creamy, so it looks beautiful on the plate.
A Few Notes Before You Start
- Toast the pistachios in a dry pan over medium heat for 3 to 4 minutes, shaking often, to deepen their flavor. Let them cool before chopping.
- Use room temperature eggs and softened cream cheese and butter. They blend more easily and give you a smooth batter and frosting.
- For a stronger pistachio taste, add ¼ teaspoon pistachio extract to the frosting along with the vanilla.
- Do not open the oven door during the first 25 minutes of baking, or the cake may sink in the center.
Bake times by pan:
| Pan type | Size | Bake time |
|---|---|---|
| Rectangular pan | 9×13-inch | 30 to 35 mins |
| Square pan | 8×8-inch | 35 to 40 mins |
| Muffin tin | 12-cup | 20 to 25 mins |
Storing Leftovers
- Refrigerate: cover the pan tightly and store in the fridge for up to 5 days. The cream cheese frosting needs to stay cold.
- Serve cold: this cake tastes great straight from the fridge because the frosting firms up slightly and the cake stays moist.
- Freezing: the unfrosted cake freezes well. Wrap it tightly and freeze for up to 3 months. Thaw overnight in the fridge, then frost and serve.
Frequently Asked Questions
Can I use fresh pineapple instead of canned?
Yes, but you must cook the fresh pineapple first to reduce its moisture. Simmer 1 cup of finely chopped fresh pineapple in a small saucepan over medium heat for about 10 minutes, then drain and cool. Canned crushed pineapple is faster and gives more consistent results.
Why did my cake turn out dense?
Two common reasons: not draining the pineapple well enough, or overmixing the batter after you added the flour. Next time, press the pineapple firmly in a strainer and fold just until the dry ingredients disappear.
Can I double the recipe?
Yes. Divide the batter between two greased 9×13-inch pans and bake them side by side, rotating shelves halfway. The bake time stays roughly the same.

Pineapple Pistachio Cake Recipe
Ingredients
Method
- Whisk together the flour, sugar, baking powder, baking soda, and salt in a large bowl.
- In a separate bowl, beat the eggs, oil, 1 tsp vanilla, and almond extract until smooth. Stir in the drained pineapple.
- Pour the wet mixture into the dry ingredients and fold gently until just combined. Fold in the chopped pistachios.
- Preheat oven to 350°F (175°C). Grease a 9×13-inch pan. Scrape the batter into the pan, spread evenly, and bake 30 to 35 minutes until a toothpick comes out clean. Cool completely in the pan on a rack.
- Beat the cream cheese and butter until smooth. Add the powdered sugar and remaining 1 tsp vanilla. Beat until fluffy. Spread over the cooled cake, top with extra chopped pistachios, and slice.
