3D-printed structures may be characterized by anisotropic fracture behavior because of their layered nature. Depending on the orientation of the sample during the layer deposition, a completely different mechanical response can be obtained, ranging from quasi-brittle to elastoplastic, and with large variations in the maximum stress to failure. In this study, an optimization framework is proposed for 3D-printed samples to maximize their resistance to fracture with respect to both the orientation of the deposited layers during the process and the topology of the sample. To achieve this, a phase-field anisotropic elastoplastic fracture model is combined with a Bidirectional Evolutionary Structural Optimization topology optimization. The model makes it possible to predict the response of the structure until failure with respect to the orientation of the deposited layers in the 3D-printing process and then optimize this orientation to maximize the mechanical response. A large increase in fracture resistance can be obtained by optimizing the orientation, and a significant increase in fracture resistance can be achieved using the present nonlinear anisotropic topology optimization compared with the use of linear topology optimization.