STP - Disabling spanning-tree

Spanning Tree Protocol (STP) is enabled by default on all Cisco IOS switches. It can be disabled in various ways:

The following command disables STP on a particular VLAN:

no spanning-tree vlan 10

Note that this command must be applied in global configuration mode. However, if applied in interface configuration mode, there is a strange behavior that you will encounter:

SW1(config)#inter gig 0/1 SW1(config-if)#no spanning-tree vlan 10 SW1(config)#

Notice that the switch puts you back into global configuration mode. How is this interpreted? It takes the command as if it was applied in global configuration mode, and puts you automatically in that mode.

Another way to essentially disable STP is to use the STP BPDU Filter feature.

Links:

https://networklessons.com/spanning-tree/troubleshooting-spanning-tree#Spanning-Tree_Disabled