SummaryBase station's location privacy in a wireless sensor network (WSN) is critical for information security and operational availability of the network. A key part of securing the base station from potential compromise is to secure the information about its physical location. This paper proposes a technique called base station location privacy via software‐defined networking (SDN) in wireless sensor networks (BSLPSDN). The inspiration comes from the architecture of SDN, where the control plane is separated from the data plane, and where control plane decides the policy for the data plane. BSLPSDN uses three categories of nodes, namely, a main controller to instruct the overall operations, a dedicated node to buffer and forward data, and lastly, a common node to sense and forward the packet. We employ three kinds of nodes to collaborate and achieve stealth for the base station and thus protecting it against the traffic‐analysis attacks. Different traits of the WSN including energy status and traffic density can actively be monitored by BSLPSDN, which positively affects the energy goals, expected life of the network, load on common nodes, and the possibility of creating diversion in the wake of an attack on the base station. We incorporated multiple experiments to analyze and evaluate the performance of our proposed algorithm. We use single controller with multiple sensor nodes and multiple controllers with multiple sensor nodes to show the level of anonymity of BS. Experiments show that providing BS anonymity via multiple controllers is the best method both in terms of energy and privacy.