I've been twice with now-DH before we had kids, once in 2010 and we stayed in Sliema for a week, once in 2017 when we stayed on Gozo for 5 nights and Valetta for 2 - we also got engaged on Gozo
so I have very fond memories.
I'd recommend Gozo as a lovely and quiet, laid back kind of place. It has sandy beaches, which Malta does as well but I think they are in the very resort-y parts where I haven't been. Gorgeous snorkeling and diving. We stayed in an airbnb that was a converted 15th (?) century farmhouse and was very atmospheric.
If you are an archaeology nerd like I am the Ggantija temple complex on Gozo is incredible, and the Hypogeum on Malta is worth going to as well. Agree that Medina is amazing and atmospheric. Good restaurants and fairly relaxed, safe-feeling nightlife in Valetta.
You can get around both islands by bus quite easily, and Valetta is very walkable (though I live in Bristol so am used to hills!)
Sliema was fine, fairly relaxed, good base for exploring, but nothing incredibly special.
Not sure anything I have described is particularly child-friendly, though maybe if you have a very young baby you can just take her with you to do the grownup stuff. As a last hurrah before you enter the world of kids' clubs and activities, it might be really nice.