The procedure to construct maximally localized Wannier functions by Bloch phase optimization was analyzed for several two dimensional photonic crystals for both fundamental polarizations, using two different locality measures. Although the stochastic, genetic algorithm is numerically too costly for routine application, it has, as a global optimization method, provided us an important benchmark to judge under which conditions the faster and less memory intensive, but local conjugate gradient method finds the global optimum of a given locality measure. We found that the commonly used second moment locality measure has generically multiple extrema, which makes it difficult to construct maximally localized Wannier functions by local optimization techniques. One may conjecture that this multiplicity results from the complex oscillatory behavior of the (not yet optimized) Wannier functions at large distances from the Wannier center, which makes the dominant contribution to the second moment. This led us to propose a new locality measure which is controlled by the behavior close the Wannier center, the integrated modulus square measure. We showed numerically by comparison of conjugate gradient and genetic algorithm optimization that this measure does not feature multiple extrema and is, therefore, suitable for fast and efficient local optimization techniques, like the standard conjugate 