(CNN) For many of us, the day doesn't start off right until we have that cuppa joe.

Just the aroma of that dark, rich brew can get our senses stirring, ready for the mood boost we know is coming.

And it turns out that coffee's not just fine for your health, it may even lengthen your life -- but only if you prepare it with a filter, according to a new long-term study published Wednesday in the European Journal of Preventive Cardiology.

"Unfiltered coffee contains substances which increase blood cholesterol. Using a filter removes these and makes heart attacks and premature death less likely," said study author Dag Thelle, a senior professor in the public health and community medicine department of the University of Gothenburg, Sweden.

"Our study provides strong and convincing evidence of a link between coffee brewing methods, heart attacks and longevity," Thelle said.

That's bad news for lovers of coffee made with the French press, or cafetière, that is so popular today, or those fond of strong Greek and Turkish brewing methods. Boiling coffee or using a coffee press can actually increase your risk of heart disease.

"Unfiltered coffee, like Greek and Turkish coffee, which is boiled, or coffee made in a French press contain higher amounts of cafestol and kahweol -- chemicals found in oil droplets floating in the coffee and also in the sediment," said registered dietitian Lisa Drayer, a CNN health and nutrition contributor.

"Studies have shown that these substances can raise triglyceride levels and LDL cholesterol levels," Drayer said. "So stick with filtered coffee, such as a paper filter that you would use in a drip-brewed coffee, which can help to trap these chemicals."

Drinking filtered coffee better for health

The new study followed over half a million healthy Norwegian men and women between the ages of 20 and 79 over a 20-year period.

Results showed drinking boiled or pressed unfiltered coffee raised the risk of death in men aged 60 and above, due to elevated cardiovascular mortality.

But drinking filtered coffee -- that through a paper filter, for example, was found to be healthier than drinking no coffee at all.

Filtered coffee was linked to a 15% reduced risk of death from any cause, a 12% decreased risk of death from cardiovascular disease in men and a 20% lowered risk of death from heart disease in women when compared to drinking no coffee.

In fact, the study found those who drank one to four cups of filtered coffee per day had the lowest mortality rate.

"The finding that those drinking the filtered beverage did a little better than those not drinking coffee at all could not be explained by any other variable such as age, gender or lifestyle habits. So we think this observation is true," Thelle said.

Evidence-based recommendations

The findings echo other research highlighting coffee's health benefits. According to the American Heart Association, filtered coffee can sharpen your mental focus, boost mood and improve performance during exercise.

The British Medical Journal published a huge umbrella study in 2017 that looked at over 200 meta-analyses of the health benefits of coffee and that found drinking three to fours cups of black coffee a day provides the most health benefits overall.

Those included lowering the risk of heart disease; numerous types of cancer; and neurological, metabolic and liver disorders; as well as overall mortality. Other studies have found coffee reduces the risk for melanoma, heart disease, multiple sclerosis, type 2 diabetes, liver disease, prostate cancer, Alzheimer's, computer-related back pain and more.

Of course, nothing is perfect. There are some reasons you may want to limit or avoid coffee.

Watch your sleep. "If you have trouble falling asleep, it's best to avoid coffee and all sources of caffeine in the evening or close to bedtime," Drayer suggested.

Careful if you're at risk for fractures. The British Medical Journal analysis found high levels of coffee consumption (over four cups a day) was associated with a higher risk of fractures in women who already had a greater likelihood, but not in men.

Pregnant women should also be wary. Higher levels of coffee consumption were found to increase risk for preterm births and stillbirths, as well as low birth weight in babies. This is possibly due to the fact that the half-life of caffeine is known to double during pregnancy, raising the dose of caffeine per cup, according to the study.

Not for those with Parkinson's. A study A study published in September 2017 reversed opinion on the benefits for Parkinson's disease, which was long thought to be helped by caffeine. Researchers who first found that coffee reduced tremors in those with Parkinson's went back and studied a larger sample of patients for a longer time. This time, they found no difference between those taking caffeine tablets and those taking a placebo. After the initial data came back negative, the study was stopped.

But for the vast majority of us, coffee is just fine, experts said.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

"For people who know they have high cholesterol levels and want to do something about it, stay away from unfiltered brew, including coffee made with a cafetière," Thelle said. "For everyone else, drink your coffee with a clear conscience and go for filtered."

To keep your coffee consumption even more healthy, Drayer suggested the following tips:

Add low-fat milk and skip the cream. "Cream contributes about 50 calories and 3 grams of saturated fat per tablespoon," Drayer said, adding that low-fat milk has fewer calories and will help to offset calcium losses (a tablespoon has only 6 calories, but 19 milligrams of calcium).

Avoid sugar in your coffee. "A teaspoon of sugar contains 16 calories. It may not sound like much, but if you add two teaspoons to your brew and drink a few cups per day, the calories add up," she said.