While a popular sight in gardens every summer, butterflies are having a tough time right now.

Thanks to a number of factors such as mild winters and habitat loss, the pretty pollinators are in decline.

In fact, 2016 was the fourth worst year on record, with 40 of the 57 species assessed suffering decreased numbers.

If you want to do your bit to help, there are things you can do to help make your garden into a better environment for them.

Here are six tips to transform your garden into a butterfly base:

1. Cut back on pesticides

Many pesticides can be harmful to butterflies and other pollinating insects so keep them away from flowering plants if you can.

2. Don’t clear up fallen fruit

If you’ve got a fruit tree in your garden and want to attract more butterflies, resist the temptation to pick up fruit that’s fallen to the ground - or, if you need to clear it, put it on the compost heap.

Some species of butterfly love to feed on rotting apples, pears and berries.

[Read more: How you can help the UK's most endangered birds]

3. Grow butterfly-friendly plants

 

A post shared by KM (@kkitchenmom) on

One sure-fire way to attract adult butterflies is to make sure you have plenty of nectar-rich flowers growing in your garden.

Butterfly favourites include lavender, hyacinth, bluebells, marigolds and many others.

For more advice on what to grow, visit the Royal Horticultural Society’s website for a comprehensive guide.

4. Have plenty of food for caterpillars too

You can’t get butterflies without caterpillars.

Keep them healthy by leaving the edges of your garden to grow a little more wild. They’ll like the long grass.

They also feed on nettles, thistles, ragwort, mixed grasses, holly and ivy.

[Read more: 10 plants that smell best in the evening]

5. Keep it warm

Mainly spotted during warmer weather, it may seem obvious to say that butterflies like balmier temperatures.

Keep them satisfied by growing their favourite flowers in your garden’s sun traps, or perhaps plant flowers in window boxes to make the most of the sunshine.

6. Give them some shelter

They like the sunshine, but typically butterflies seek shelter during bad weather.

Usually they’ll hide under large leaves, so if you’ve got trees, shrubs or hedgerows, there should be plenty of secluded spots for them to wait out the temperamental weather.

How do you try to attract more butterflies into your garden? Let us know in the Comments section below.