To reduce the power consumption of 5G ultradense small cell networks, base stations can be switched to low power sleep modes when local traffic levels are low. In this paper, a novel sleep mode control algorithm is proposed to control such sleep modes. The algorithm innovates a concept called Traffic-Aware Cell Management (TACM). It involves cell division, cell death and cell migration to represent adaptations of networks, where state transitions of base stations are controlled. Direction of arrival is adopted for distributed decision making. The TACM algorithm aims at reducing the network power consumption while alleviating the impacts of applying sleep modes, such as mitigating system overheads and reducing user transmission power. The TACM algorithm is compared with a recent consolidated baseline scheme by simulation on networks with unbalanced traffic distributions and with base stations at random locations. In contrast, the TACM algorithm shows a significant improvement in mitigating system overheads due to no load information exchange overhead and up to 72 times less switching frequency. Up to 81% network power consumption can be reduced compared with the baseline scheme if considering high energy consumption of switching transient states. In addition, at a low traffic level, average uplink transmission power is reduced by 79% comparatively. Furthermore, the impact of important performance governing parameters of the TACM algorithm is analysed. The insensitivity to the estimation accuracy of direction of arrival is also demonstrated. The results show that the proposed TACM algorithm has a comprehensive advantage of power reduction and overhead mitigation over the baseline scheme.