Preheat oven to 350°F (175°C) and line a muffin pan with cupcake liners.
In a bowl, whisk flour, baking powder, baking soda, salt, and ground hazelnuts.
In a separate bowl, cream butter and sugar until light and fluffy (2–3 minutes).
Beat in eggs one at a time, then mix in vanilla and hazelnut extract.
Add espresso and mix until combined.
Alternate adding dry ingredients and milk, beginning and ending with dry. Mix just until smooth.
Divide batter evenly among liners, filling about ⅔ full.
Bake 18–22 minutes, or until a toothpick comes out clean.
Cool completely before frosting.