Magnetic ordering, as one of the most important characteristics in magnetic materials, could have significant influence on the band structure, spin dependent transport, and other important properties of materials. Its measurement, especially for the case of antiferromagnetic ordering, however, is generally difficult to be achieved. Here we demonstrate the feasibility of magnetic ordering detection using a noncontact and nondestructive optical method. Taking the compressive strained tetragonal BiFeO3 (BFO) as an example and combining density functional theory calculations with the minimal one-band tight-binding models, we find that when BFO changes from C1-type antiferromagnetic (AFM) phase to G-type AFM phase, the top of valance band shifts from the Z point to {Gamma} point, which makes the original direct band gap become indirect. This can be explained by the two-center Slater-Koster parameters using the Harrison approach. The impact of magnetic ordering on energy band dispersion dramatically changes the optical properties of tetragonal BFO. For the linear ones, the energy shift of the optical band gap could be as large as 0.4 eV. As for the nonlinear ones, the change is even larger. The second-harmonic generation coefficient d33 of G-AFM becomes more than 13 times smaller than that of C1-type AFM case. Finally, we propose a practical way to distin-guish the C1- and G-type AFM of BFO using the optical method, which might be of great importance in next-generation information storage technologies and widens the potential application of BFO to optical switch.