Piskei Tshuvos: How Fresh Do Your Matzos Need To Be?
The Shulchan Aruch (OC458:1) says that the time to bake your Matzos is Erev Pesach after Chatzos since Matza is compared to the Korban Pesach whose proper time is after Chatzos. (In fact there is a minhag brought in the siddur of the Arizal to say Hallel Shalem with a bracha while baking, just like they did in the Bais HaMikdash while bringing the Korban Pesach.) The Mishna Brura concludes that the Shulchan Aruch holds this to be a Minhag and not a Din. Therefore if one baked Matzos even a month or two before Pesach it is okay Bidi’eved.
The Bais Yosef says that this only applies to Matza that will be used for the Mitzva at the Seder. The Bach holds that if you bake Matza more than thirty days before Pesach you are not Yotzei with those matzos. The Chok Yaakov says that if you need to bake Matzos and send it to a faraway place you may bake it even before thirty days.
Similarly says the Piskei Tshuvos if the amount of matza needed requires the bakeries to start production more than a month before, it is also okay. However he says, if possible one should try to use matza baked within thirty days of Pesach to be machmir like the Bach.
Lastly he brings the Maharsham (6:99) who says you may even use Matza leftover from last year if you were careful to watch them from Chometz all year.
Important Note: We try to convey the Tshuva to the best of our ability. We admit that our understanding may not be accurate. Please also understand that this Tshuva may not be the final word on this topic. One should consult a Rav before drawing any conclusions.