In this paper, we use the Gauss–Bonnet theorem to obtain the deflection angle by the photons coupled to Weyl tensor in a Schwarzschild black hole and Schwarzschild-like black hole in bumblebee gravity in the weak limit approximation. To do so, we first calculate the corresponding optical metrics, and then we find the Gaussian curvature to use in Gauss–Bonnet theorem, which is first done by Gibbons and Werner. Hence, in the leading order terms we show the deflection angle, that is affected by the coupling between the photon and Weyl tensor, and there is a deviation from the deflecting angle as compared with Schwarzschild black hole with Schwarzschild-like black hole in bumblebee gravity. Moreover, we investigate the deflection angle by Einstein–Rosen type wormhole in Weyl gravity and in bumblebee gravity. Interestingly, the deflection angle by Einstein–Rosen type wormhole in bumblebee gravity is found as larger than the deflection angle by Einstein–Rosen type wormhole in Weyl gravity.