Mix your dry ingredients, flour, unsweetened shredded coconut, baking powder, baking soda, salt, and xanthan gum in a separate bowl using a whisk.
In a separate bowl, mix the canned coconut milk and vanilla extract mixture and set it aside.
In a stand-alone mixer with a paddle attachment, mix the butter and sugar together at medium to high speed until light and fluffy, about 2 to 3 minutes.
Then lower the mixer speed to low speed and add the eggs one at a time until all the ingredients are combined.
Add half the dry ingredients followed by the coconut milk and vanilla mixture and beat at low-medium speed until combined.
Then add in the remaining amount of the dry ingredients and mix until combined.
Align your cupcake pan with cupcake liners. Using a spoon or a spatula, fill the cupcake liners about ⅔ full. The batter should give you exactly 12 cupcakes.
Bake the cupcakes for about 17-19 minutes until the edges are golden or until a toothpick inserted at the center of the cupcake comes out clean.
Let the cupcakes cool inside the cupcake pan for 5 minutes before transferring them to a cooling rack to further cool. Do not decorate or apply cream cheese frosting to the cupcake until the cupcake’s temperature reaches room temperature.