Flour does expire and does eventually go bad.
If the flour smells good and has not started to turn and off shade from the normal color then it's fine.
If the flour smells rancid, it's probably bad.
If the flour has started to turn an off-shade from what you'd expect, it's probably bad.
And of course, if there are any signs of pests like bugs or droppings, throw it out immediately.
Flour doesn't look like a raw food, but most flour is raw.
That means it hasn't been treated to kill germs that cause food poisoning, such as Escherichia coli (E. coli) and Salmonella.
These harmful germs can contaminate grain while it's still in the field or flour while it's being made.
White flour is almost certainly fine to use, no matter its age.”
If you keep your flour in an airtight container in the pantry, you can keep your flour for well over a year without a problem.
You can add old flour to your compost by sprinkling it between layers of coarse organic matter.
The little particles disappear quickly when scattered into the crevices of decaying plants, and do not give off odors that attract pests.