A controller for a work machine includes a steering control circuit, a memory, and a speed control circuit. The steering control circuit is configured to control a steering of the work machine to change a steering angle based on a travel route. The memory is to store a threshold angle. The speed control circuit is configured to control a speed of the work machine if the steering angle is equal to or larger than the threshold angle and if the steering control circuit does not control the steering.