Butterflies are naturally attracted to many types of flower blooms for sources of food (nectar). Attract butterflies to your yard with many types of colorful flowers that produce nectar.
You must also consider that the butterflies will also use these flowering plants to lay their eggs for caterpillars to feed upon when they emerge.
Most butterflies are picky about where to lay their eggs so be sure to grow the correct plants for the butterflies (and caterpillars) for your geographical area.
Usually the damage caterpillars do to a plants leaves while feeding is temporary and minor, and many feed upon plants humans consider weeds. If you don't remove all weeds from your property, you will benefit future populations of butterfly species.
Do not use pesticides in your butterfly garden (or your food garden either for that matter) learn how to garden organically.