Within the framework of NRQCD, the photoproduction of doubly heavy baryons Ξcc, Ξbc, Ξbb and their P-wave excited states has been systematically investigated. The production mechanism is that a color anti-triplet or sextuplet diquark ⟨QQ′⟩ is first produced, and then evolved into a corresponding doubly heavy baryon \( {\Xi}_{QQ^{\prime }} \) via the subprocess γ + γ → ⟨QQ′⟩[n] + \( {\overline{Q}}^{\prime } \) + \( \overline{Q} \) → \( {\Xi}_{QQ^{\prime }} \) + \( {\overline{Q}}^{\prime } \) + \( \overline{Q} \) . Here, Q(′) denotes the heavy quark b or c, [n] is the color and spin quantum number of intermediate diquark, which can be \( {\left[^3{S}_1\right]}_{\overline{\textbf{3}}/\textbf{6}} \) and \( {\left[^1{S}_0\right]}_{\overline{\textbf{3}}/\textbf{6}} \) for S-wave states, or \( {\left[^1{P}_1\right]}_{\overline{\textbf{3}}/\textbf{6}} \) and \( {\left[^3{P}_J\right]}_{\overline{\textbf{3}}/\textbf{6}} \) with J = 0, 1, 2 for P-wave states. Predictions for the cross sections, differential distributions, and theoretical uncertainty have been analyzed. The results indicate that, at \( \sqrt{s} \) = 91 GeV, the contribution of photoproduction for P-wave Ξcc, Ξbc, and Ξbb is approximately 2.19%, 4.23%, 1.26% of the contribution for S-wave, respectively. As the collision energy increases, the contribution of P-wave also increases. Assuming that the highly excited state can decay into ground state with 100% efficiency, the total produced events at CEPC and FCC-ee can be as high as \( \mathcal{O}\left({10}^8\right) \) , \( \mathcal{O}\left({10}^7\right) \) , and \( \mathcal{O}\left({10}^5\right) \) corresponding to Ξcc, Ξbc, and Ξbb, respectively, which is very promising to be detected in future experiments.