You can get rid of lore flags with this.
Code:
update items set loregroup = 0 where id > 0;
I might be mistaken but I think I remember someone saying that there is suppose to be a rule in the rule_values table for ditching lore flags. If there is then that would be a better option than using sql to do a mass change.