I would like to turn on / turn off all labels of any layer by one klick. Like you can do in ArcGIS according to that post:

Is there a way to turn off all labels in ArcMap without clicking on every layer?

2 Answers 2


Not sure if there is an existing option to do this but using a bit of python, we can always create such a function ourselves!

So we could:

  1. Create a temporary icon on the toolbar which can toggle.
  2. Create a function which enables/disables labeling for each layer depending on the toggle state of the icon.
  3. Connect the icon to the function.

The code could look something like this which you can paste into the Python Console:

from PyQt4.QtCore import QObject, SIGNAL
from PyQt4.QtGui import QAction, QIcon

action = QAction(QIcon(""), "Turn labels" + "\n" + "ON/OFF", iface.mainWindow())

def label_control():
    for layer in QgsMapLayerRegistry.instance().mapLayers().values():       
        if action.isChecked() == True:      
            layer.setCustomProperty("labeling/enabled", True)
            layer.setCustomProperty("labeling/enabled", False)

QObject.connect(action, SIGNAL("triggered()"), label_control)
# Uncomment line below if you want to remove the icon yourself,
# otherwise it will be removed automatically when you restart QGIS


Couple of layers which have labelling enabled (toggled):

Enabling labels

Same layers but with the labels disabled (untoggled):

Disabling labels

  • 1
    great solution!
    – matteo
    Jan 30, 2017 at 15:09
  • Fine, that's it.... but I have no clue, how to do so... BTW: interesting point layer :-)
    – MartinMap
    Jan 30, 2017 at 15:10
  • @matteo - Thanks, used something similar in a plugin as I found it useful for my particular use-case :)
    – Joseph
    Jan 30, 2017 at 15:12
  • @MAP - It does not work for you? Also yes, ignore the point layer :)
    – Joseph
    Jan 30, 2017 at 15:14
  • 1
    @MAP - I've asked a new question concerning rule-based labels as I couldn't find much information as to how we can control them using pyqgis.
    – Joseph
    Jan 31, 2017 at 11:36

In QGIS 3.12 you find the plugin "Deactivate Active Labels" which offers a neat possibility to toggle labels of all layers. At the time of writing the plugin's GitHub repository was quite young, thus the plugin may not be available or compatible to previous versions of QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.