In this work, the rising dynamics of a threedimensional (3D) Taylor bubble in vertical and inclined tubes filled with yield stress fluids are investigated by means of direct numerical simulations. The gas−liquid interface is captured by the volume-of-fluid (VOF) method with adaptive mesh refinement technique. The Herschel−Bulkley model is used to evaluate the rheological behavior of viscoplastic fluids that exhibit a yield response. The reliability of the present simulation to capture the bubble shape and liquid film for a deformed Taylor bubble is validated by comparisons with experimental results in the literature. Our findings reveal a non-monotonic correlation between the stable bubble velocity and yield stress values across a broad range of values. The interplay among the shear stress generated by the rising bubble, the fluid's yield stress, and the pressure gradient due to changes in the liquid film thickness is primarily responsible for this phenomenon. In addition, different from the symmetrical liquid film and flow field observed in vertical tubes, the symmetrical characteristic is lost in inclined tubes. The results also reproduce the peculiar phenomenon that the rise velocity of Taylor bubbles peaks at a certain inclination angle in yield stress fluids. At smaller inclined angles, the shear stress generated by the tail flow field could overcome yield stress, causing the fluid around the bubble tail to have shear-thinning characteristics. As the tube further tilts, the lower liquid film gradually thickens, and the bubbles behave as if they are in a Newtonian fluid. This work provides important insights into the petroleum industry involving complex yield stress fluids, as well as an understanding of the mechanisms of Taylor bubble dynamics in inclined tubes.