[GIS] Stop layer from showing up in legend on composer

legendprint-composerqgis

When I add a legend in a map composer in QGIS, all layers that are defined in the project will be shown in the legend, no matter if they are set to be displayed or not, I also have some background maps I would like to never show up in the legend.

So:
1) Is there a way to tell Qgis not to list layers that are not displayed in the legend?
2) Is there any way to tell Qgis to never list a layer in a legend?

(In my case, I would like to never ever show the background layers or the non-displayed layers the legend)

(using Qgis 3, but have had the same issue for quite a few 2.x versions as well)

Best Answer

In the print composer, you are able to control the contents of the legend by turning off the Auto Update. (The Checkbox in the upper left hand corner of the legend control window above the layer list)

enter image description here

Then after that box is unchecked Click on the Blue Funnel to instruct the print composer to only display the currently displayed layers.

enter image description here

You can then use the "-" button to hide other layers of your choosing.

I have highlighted the Background image here with the palette.

enter image description here

I then click on the "-" button beneath the layer list to remove that layer from the legend.

enter image description here

That is how it works for me.