Bacalhau à Zé do Pipo (Codfish in the style of Zé do Pipo) is a classic Portuguese codfish recipe and one of the most beloved dishes in Portugal, it’s almost an institution by itself. This is my mom’s variation on the traditional recipe, but it’s still pretty much the typical version and in my humble opinion maybe a little bit better hehehe not biased at all.
In case you don’t know the classic recipe, it’s basically a mashed potato and codfish pie, with cooked shredded codfish inside (good way to make use of scraps of codfish), and it’s normally seasoned with mayo on the fish or top of the mashed potatoes and everything baked until golden in the oven.
But my mom’s version is a bit different, first, the codfish isn’t shredded, it’s cooked and deboned, but It’s still kept in large loins that is you still have big chunks of fish, and it’s not all shredded, which makes a huge difference both in texture and in the richness of the dish. It also takes a bit more care and time making a really rich and caramelized onion mixture, this not only creates a contrast of aromas but increases the flavor of the codfish.
And finally, It’s arranged with the codfish around the edges and the mayonnaise in a very thin layer in the center. I do this because in many of the common ways of making Bacalhau à Zé do Pipo you get pieces with no mayonnaise at all and others with a heaping spoonful of mayo, but also simply making a layer of mashed potatoes over everything, like with a shepherd’s pie and then another layer of mayonnaise over everything wouldn’t create variety, it solves the issue but looks boring.
This way, each spoonful that goes around the edges you get the mashed potatoes and has a thin layer of mayonnaise on top, but not mixed into the purée, it’s perfect heheheh! So let’s get to the recipe!
Portuguese Baked Codfish with Mashed Potatoes and Mayonnaise • À Zé do Pipo

BBacalhau à Zé do Pipo its one of those codfish recipes absolutely perfect for parties and big gatherings like Christmas, Easter, New Years, since you can make a really nice hefty portion that can feed anyone, less codfish? Add more potatoes heheheh.
Ingredients
- Codfish – 1200g (Loins/Fillets)
- Potatoes – 2kg (Good for Boiling)
- Milk – +/- 2 liters (Semi-Skimmed)
- Milk – as needed (for the Mash)
- Onions – 5 large
- Garlic – 4 cloves
- Bay Leaf – 1 Leaf
- Butter – A Knob
- Mayonnaise – To Taste (Enough to Cover)
- Olives – Optional (Black or Green)
- Olive Oil – A Few Drops
- Herbes de Provence – A Pinch
- Oregano – A Pinch
- Pepper – A Pinch
- Salt – A Pinch
Directions
- If the cod is still dry and salty, you need to start by soaking it, check below for the instructions to soak dry portuguese codfish. If you are unsure, just buy already unsalted frozen codfish (this is not the same as fresh/frozen codfish).
- When the cod is ready to cook, place it in a large pan and cover with milk (you don’t need 2 liters, just enough to cover all the cod), cook for about 10 to 15 minutes until it starts to flake, remove from the heat and place on kitchen paper to drain a little.
- While the cod is still hot, start removing the skin and bones (it’s easier when the fish is still hot), trying not to break it up too much and keeping the fillets intact. Place these at the bottom of the serving dish.
- Then start preparing the onion in a large frying pan. Add 5 large onions, thinly sliced, followed by the chopped garlic, a few drops of olive oil, Provençal herbs, oregano, salt, and pepper. Cover and cook over low heat for about 40 minutes until the onion is completely soft and caramelized (stir and check occasionally, if the skillet starts to get dry, add a little more olive oil).
- Pour the onion mixture over the cod and remove the bay leaf.
- Wash, peel, and halve the potatoes, place them in a pot with plenty of water and a pinch of salt, and cook over medium heat for about 10 to 15 minutes. Prick with a fork or knife; if you don’t feel any resistance, the potatoes are cooked. Remove from the heat and drain.
- If you have a potato masher, use it; if not, use a fork to mash the potatoes, add a little hot milk and a knob of butter in the end, mix until you have a purée with a good consistency, taste and season with salt and pepper.
- Preheat the oven to 200ºC. As everything is already cooked, you are going to place it in the oven just to brown (so if the top looks good, it’s time to take it out of the oven).
- Now arrange the purée around the dish/baking tray, finally pour a few spoonfuls of mayonnaise in the center and spread it around. You don’t need much mayonnaise, just enough to cover it and not be visible underneath, 2mm is enough.
- Bake in a hot oven for about 10 to 15 minutes until everything is golden brown, and it’s ready to serve. Accompany with a Portuguese Cabbage Stir Fry or a salad 😉 Bon appétit and Merry Christmas.

If you bought salted portuguese codfish, here are some quick instructions to remove the salt and hydrated the codfish, place the salted codfish in a large container with the skin side up. Cover completely with cold water, make sure there’s plenty of water, at least double the amount of fish.
Change the water every 6 to 8 hours (at least 3 to 4 times total). Keep the container in the refrigerator during this process. After about 24 hours, taste a small piece of the fish. If it’s still too salty, continue soaking and changing the water for another 12 to 24 hours, maximum. Then drain the water and is ready to use in the recipe.
This recipe can also be made way ahead of time. You can cook the codfish and make the onion mixture 1 day before, and then on the actual day just make the mashed potatoes, assemble everything, and bake, again perfect for get-togethers!
If you want a version that serves more people (or you have less codfish), then it’s best to shred the codfish and mix it with the onion mixture. In fact, if you’re going to shred it, buy cheaper codfish cuts, you don’t need to buy the more expensive codfish loins.
You can use the milk from cooking the codfish to help with the mashed potatoes, but in my case I want my mashed potatoes to taste really good and potato forward, so I don’t use the codfish cooking milk for the purée, but! BUT! If you are not adding as much codfish, then yes it’s a great idea to make the mashed potatoes more codfish flavour!
Try and use a good thick potato, with a low startch content these are always the best to boil and make mashed potatoes ;D
For Storage, the leftovers can be stored covered in the refrigerator for up to 3 days. Reheat in a 180ºC (350ºF) oven until warmed through.
This dish can be frozen before baking. Assemble completely, cover tightly, and freeze for up to 1 month. Bake from frozen, adding 10 to 15 extra minutes to the cooking time, it doesn’t come out perfect, but it works pretty good.
This recipe for Portuguese Baked Codfish with Mashed Potatoes and Mayonnaise • À Zé do Pipo was originally created on BakeAfter.com. Esta receita de Bacalhau à Zé do Pipo da Cristina foi publicada em português no Iguaria.com.
Nutrition
Per Serving: 564 calories; 14.3 g fat; 34.1 g carbohydrates; 22.2 g protein.Did you try this recipe?
Let me know how it turned out for you! Leave a comment below ;D