A gateway or sensor hub on Ethernet doesn't need its radios. Turning them off in firmware removes interfaces nobody monitors, and it's cleaner than blacklisting kernel modules or bringing wlan0 down with a boot script (older answers suggest both).
Procedure
-
Edit
config.txt, at/boot/firmware/config.txton current Raspberry Pi OS (/boot/config.txton older installs):[all] dtoverlay=disable-wifi dtoverlay=disable-bt -
Reboot and check that the interfaces are gone:
ip link # no wlan0 bluetoothctl list # no controller
Use only one of the two lines if you need the other radio.
Side effect worth knowing
On models before the Pi 5, Bluetooth occupies the full-featured UART. disable-bt gives UART0 (ttyAMA0) back on GPIO 14 and 15, which is what you want for reliable serial communication with sensors or modems. The overlay documentation limits this UART side effect to pre-Pi 5 models; on a Pi 5, see the UART item for its serial setup.
Notes
- The overlays are applied by the firmware at boot, so there's nothing to keep running.
- Very old firmware needed a
pi3-prefix on these overlay names; current firmware doesn't. - If you also use
rfkillor NetworkManager to switch radios off, the firmware setting wins: the device simply doesn't exist.
Sources: Stack Exchange (CC BY-SA 4.0) — see links.