The WHO recommends that less than 10% of our "total energy intake" be due to free sugar. From the cited report:
Total energy intake is the sum of all daily calories/kilojoules consumed from food and drink. Energy comes from macronutrients, such as fat (9 kcal/37.7 kJ per gram), carbohydrate (4 kcal/16.7 kJ per gram) including total sugars (free sugars + intrinsic sugars + milk sugars) and dietary fibre, protein (4 kcal/16.7 kJ per gram) and ethanol (i.e. alcohol) (7 kcal/29.3 kJ per gram). Total energy intake is calculated by multiplying these energy factors by the number of grams of each type of food and drink consumed and then adding all values together.
Doesn't this technically mean that it's okay for me to eat huge amounts of sugar as long as I also eat a ten plates of pasta a day, or something? What is the rationale for using this metric, and how do I know that I'm eating a healthy amount of sugar because I'm eating low sugar, and not because I'm just eating more non-sugar calories than I should be?