Monodisperse YF and YOF porous sub-microspheres were synthesized by using a novel sacrificing template method with amorphous Y(OH)CO ⋅x H O as the precursors and the template. It was found that the size and shape were well maintained, and the condensed precursor was transformed into uniform porous structures after fluoridation. By fine-tuning the feed of the fluorine source, the final product could be converted from YF to YOF. A possible growth mechanism is proposed for the uniform porous YF structure and the porous yolk-shell-like YOF structure. The luminescence properties showed that the as-synthesized YF :Ln (Ln=Eu, Tb, Ce, Ce/Tb, Yb/Er, Yb/Ho, and Yb/Tm) products exhibited strong multicolor emissions, which included down-/upconversion and energy-transfer processes. Additionally, YOX (X=Cl and Br) could be obtained if a different halogen source was used during calcination. However, the spheres were almost completely destroyed. Our novel synthetic route can also be extended to other lanthanide fluorides (REF , RE=Gd, Lu), which may open a facile way to fabricate novel porous nanostructures.