Porto is not a 24-hour food city. If you want a proper meal after a night out, choose the place before you are hungry and check that the kitchen, not just the bar, is still serving. These are two options I would check first, depending on where you are.
In Cedofeita: Museu d’Avó
Museu d’Avó, at Travessa de Cedofeita 54/56, is a late dinner of Portuguese petiscos rather than a fast-food stop. Visit Porto describes it as a place for a long meal of small plates before going out and says food is served late. I would check the current hours and call if arriving close to closing; a late kitchen is not an invitation to walk in at the last minute.
In Foz on Friday or Saturday: BH Foz
If you are already by the sea, BH Foz publishes Friday and Saturday dinner service until midnight, then keeps the bar open later. That is useful after a concert or an evening in Foz, but it is not a reason to travel across town without checking the day’s service. See the venue’s current kitchen and bar hours before setting off.
Ask this before you sit down
“A cozinha ainda está aberta?” means “Is the kitchen still open?” Ask it at the door, and ask what time last orders are. A room can still be serving drinks after the hot food has stopped. If you need a full meal, do not rely on a search result that only says “open.”
My backup when it is too late
If both kitchens are closed, do not wander across Porto hoping for a restaurant. Check delivery availability at your actual address, or keep something simple in your room: fruit, crackers, nuts or bread. I have learned that the hard way after a late train. It is less exciting than a midnight francesinha, but it beats finding a locked door on an empty stomach.
For a late meal, book or call when you can, check the kitchen hours on the same day, and keep the route home in mind. That is the whole trick.