Skip to content
Portuguese kitchenCod with mashed potato and mayonnaise

Bacalhau à Zé do Pipo

Thick cod loins sit under onion, mayonnaise and piped potato, then bake until golden with olives, pickles and parsley.

Bacalhau à Zé do Pipo baked with onion, mayonnaise, piped potato, black olives and parsley.
4 servingsservings
1hpreparation
1hcooking
Mediumdifficulty

A Porto cod gratin named for its creator

Bacalhau à Zé do Pipo layers desalted cod, soft onion, mayonnaise and mashed potato before a final golden bake.

Bacalhau à Zé do Pipo is a northern Portuguese cod dish associated with Porto. The Centro Interpretativo da História do Bacalhau attributes it to José Valentim, a Porto restaurant chef known as Zé do Pipo, and says it became famous in the 1960s after winning a food-value contest. That source’s account gives the dish a documented creator and regional connection. It also records a version built around a cod loin, homemade mayonnaise and potato purée. This recipe keeps those defining layers while following a contemporary four-serving method for frying the fish and baking it with the topping.

The structure is easy to recognize: a thick portion of desalted cod sits under soft onion and mayonnaise, with mashed potato piped or spooned around the fish. The oven browns the mayonnaise and potato edges while the cod finishes cooking. Dark olives and parsley are documented garnishes; chopped pickles are another source-listed finishing touch. The dish is richer than a simple baked fish supper because olive oil, mayonnaise and buttery potato are all part of the construction, so each element should be measured and layered deliberately.

The selected contemporary TeleCulinária recipe serves four and lists four cod portions, 800 g potatoes, three large onions, three garlic cloves, 300 g mayonnaise, olive oil and milk. It instructs the cook to boil and mash the potatoes, flour and fry the thawed cod, soften the onion and garlic, pipe the purée around the fish, spread on mayonnaise and bake at 200 °C. Its listed total is two hours, split evenly between preparation and cooking. Ingredient brands on the page are not required; the recipe uses generic equivalents.

A historic recipe record differs in details: it lists a cod loin, homemade mayonnaise, white wine, butter, pickles, olives and parsley, and describes lightly frying the fish before adding warm oil, garlic, onion and wine. Another Portuguese cookbook transcription describes poaching cod in milk and covering it with onion, mayonnaise and piped mash. These are related versions, not a single immutable formula. This edition uses the modern source’s four-piece frying-and-baking sequence and adds source-documented olive, pickle and parsley garnishes. The 50 g butter comes from the historical ingredient list and is used in the potato purée.

Salted cod must be desalted before it can be cooked for this recipe. Start with ready-desalted cod loins, thawed overnight in the refrigerator if frozen. The two-hour time assumes the fish is ready to cook; soaking dried salted cod is additional advance preparation and should follow the package or fishmonger’s instructions. Rinse only as directed for the product, then keep the fish cold and dry it well before coating. Removing surface moisture helps the light flour coating adhere and prevents excess spattering in hot oil.

The potato purée should be smooth enough to pipe but firm enough to hold a border around the fish. Boil the potatoes until a knife enters easily, drain thoroughly and let steam escape before mashing. Warm the milk and add it gradually with the butter. The source gives 800 g potatoes and 150 ml milk; potato variety and moisture can change the texture, so do not pour in all the milk automatically if the mash is already soft. Season with salt, pepper and a small amount of nutmeg without masking the cod.

Cook the onion slowly in olive oil with garlic and a bay leaf until soft and pale gold. This gentle step develops sweetness that balances the salty fish and tangy mayonnaise. The TeleCulinária method cooks the onion until golden; the older cookbook description says it should remain soft and white, showing how household styles differ. This version stops at translucent with just a little color and removes the bay leaf before assembly. Keep the garlic from darkening, since scorched garlic can make the topping bitter.

Dry the cod, dust it lightly with flour and fry both sides briefly in olive oil. The fish does not need to be fully cooked in the skillet because it will finish in the oven. Arrange the portions in a shallow ovenproof dish, spoon the onion mixture over them and spread mayonnaise across the fish. Pipe or neatly spoon the potato around the edges. The border contains the onion and fish juices and gives the dish its familiar gratin appearance. Avoid burying the cod under an unnecessarily thick layer of potato.

Bake at 200 °C until the mayonnaise is golden and the thickest cod portion reaches 63 °C / 145 °F. The source gives an oven temperature but no exact baking duration, so the 12–18 minute range is an estimate that depends on fish thickness and starting temperature. Check the center with a food thermometer; opaque flesh that separates easily is a useful visual cue but does not replace the safety endpoint. If the top colors too quickly, cover it loosely with foil and continue heating the fish through.

Use commercially prepared mayonnaise or mayonnaise made with pasteurized eggs, and keep it chilled until assembly. This choice follows the modern source’s use of prepared mayonnaise and avoids introducing raw unpasteurized egg into the dish. Once the casserole is baked, serve it promptly. Leftovers should be cooled in shallow containers within two hours, refrigerated and used within four days. Reheat the fish and potato to 74 °C / 165 °F throughout, covering loosely to reduce drying.

Serve each cod portion with some of the soft onion, browned mayonnaise and piped potato. Add the olives, chopped pickles and parsley after baking so their color and sharper flavors remain distinct. The recipe is substantial on its own; any additional side dish is optional and is not part of the source formula. The result is a northern Portuguese cod gratin with a recorded Porto association and several documented variants, rather than a claim that every cook in the region follows exactly the same version.

Ingredients, measured with care

Recipe card

Bacalhau à Zé do Pipo

servings4 servings
preparation: 60 mincooking: 60 mintotal time: 2 hr

Cod and onion

Potato purée and seasoning

Garnish

Equipment

Method

Boil and mash the potatoes

Peel the potatoes, cut large ones in half and simmer in salted water until a knife slides into the center, about 20–25 minutes. Drain well and mash or rice them while hot. Beat in the warm milk and butter until smooth; season lightly with salt, pepper and a little nutmeg. Keep warm.

Soften the onion and garlic

Slice the onions into half-moons and finely chop the garlic. Warm about half the olive oil in a wide skillet over medium-low heat. Add the onion, garlic and bay leaf; cook slowly until soft and lightly golden, about 15–20 minutes, stirring often. Do not let the garlic burn. Remove the bay leaf.

Lightly fry the cod

Pat the desalted cod completely dry and check for remaining bones. Dust lightly with flour, shaking off excess. Heat the remaining oil in a skillet and fry the portions briefly on both sides until lightly golden; they will finish in the oven. Transfer to a plate. If the pan is crowded, fry in batches.

Assemble the dish

Heat the oven to 200 °C / 400 °F. Set the cod portions in an ovenproof dish and spoon the softened onion over them. Spread mayonnaise over the fish. Spoon the potato purée into a piping bag and pipe a border around the cod, or mound it neatly with a spoon.

Bake until golden and garnish

Bake until the mayonnaise is lightly browned and the cod reaches 63 °C / 145 °F at its thickest point, about 12–18 minutes; timing depends on portion thickness and the dish. The fish should be opaque and separate easily with a fork. Scatter with chopped pickles, dark olives and parsley. Refrigerate leftovers within 2 hours and use within 4 days.

Tips for success

01

02

03

04

Common questions while cooking

ProblemWhat to do
The potato purée is loose.Drain the potatoes thoroughly and let excess steam escape before mashing. Beat in the warm milk gradually rather than adding it all at once.
The mayonnaise browns before the cod is hot.Cover loosely with foil and continue baking until the thickest cod portion reaches 63 °C / 145 °F.

Substitutions

Original ingredientPractical substituteWhat changes

Storage and reheating

Cool leftover cod and potato promptly in shallow covered containers.

Refrigerate

Refrigerate leftovers within 2 hours and use within 4 days.

Reheat

Reheat the fish and potato to 74 °C / 165 °F throughout. Cover loosely and warm gently to limit drying.

Frequently asked questions

Who was Zé do Pipo?

The Centro Interpretativo da História do Bacalhau identifies him as José Valentim, a Porto restaurant chef whose cod recipe became famous in the 1960s after winning a food-value contest.

Can I use salted dried cod?

Yes, but buy it already desalted or allow separate time to soak it safely according to the package directions. Desalting is not part of the two-hour preparation estimate here.

Can I assemble it ahead?

Prepare the purée and onion separately, chill them promptly, and assemble shortly before baking. Keep the cod and mayonnaise refrigerated until needed.