We use nuclear magnetic resonance (NMR), high-resolution x-ray and neutron scattering to study structural and magnetic phase transitions in phosphorus-doped BaFe\(_2\)(As\(_{1-x}\)P\(_x\))\(_2\). Previous transport, NMR, specific heat, and magnetic penetration depth measurements have provided compelling evidence for the presence of a quantum critical point (QCP) near optimal superconductivity at \(x=0.3\). However, we show that the tetragonal-to-orthorhombic structural (\(T_s\)) and paramagnetic to antiferromagnetic (AF, \(T_N\)) transitions in BaFe\(_2\)(As\(_{1-x}\)P\(_x\))\(_2\) are always coupled and approach to \(T_N\approx T_s \ge T_c\) (\(\approx 29\) K) for \(x=0.29\) before vanishing abruptly for \(x\ge 0.3\). These results suggest that AF order in BaFe\(_2\)(As\(_{1-x}\)P\(_x\))\(_2\) disappears in a weakly first order fashion near optimal superconductivity, much like the electron-doped iron pnictides with an avoided QCP.