I am building a couple data packages in QGIS - that is, QGIS projects full of useful data for my colleagues to use. The problem is, if I open the project without any internet, all the WMS layers will fail to connect and they will be lost from the project. This is not a big problem for me because I can work around it, but this is certain to be annoying when for my colleagues when I pass it on to them to use.

Here is an example. There are 12 layers that are currently failing to connect when I open the project (this is currently due to something server-side). (screenshot of "bad layers" window)

If I click cancel, the window disappears and I can work on the project. If click "OK", I'll be warned about losing these layers first:

(screenshot of warning)

In both cases, I'm taken to the project, and these layers are no longer in the layers list. If I save the project, this change will be permanent, and I'll need to manually add the layers again. That's not a big issue for me, but I'm passing this on to people who are not as comfortable with QGIS.

Is there any way to stop this happening?

I see a similar question here, unsolved: Prevent QGIS from loading WMS services when opening project

  • Are the WMS layers actually lost, or just not loaded?
    – nmtoken
    Jul 19, 2017 at 21:38
  • @nmtoken I edited the OP to try to answer this question. The layers disappear from the project entirely, so if I save it I'll need to add them again manually.
    – Jamesypoo
    Jul 25, 2017 at 13:10
  • 1
    The same applies to non-internet layers that might be stored on an external drive or something like that. I find it intensely annoying to have to keep adding them - if you don't get an answer I'd suggest logging a feature request to QGIS. It can't be that difficult to simply park those layers and ask again when you reopen the project. Jul 25, 2017 at 13:39
  • I agree. Do you know where to make a feature request?
    – Jamesypoo
    Jul 25, 2017 at 15:01
  • In project > project properties > macros you can write python code to automatically run when the project is opened. It shouldn't be too difficult to check if the wms layer is loaded and load it again if not Jul 25, 2017 at 16:10

1 Answer 1


I don't know how to solve the problem of losing WMS layers when opening projects offline. I was however having a similar problem losing WMS layers while online after a 24 hour period. This worked for me - Under Settings>Options>Network>General increase the Default expiration period for WMS Capabilities (hours) setting from the default value of 24 hours. The maximum value permited is 99999999 which is good for 100+ years. QGIS documentation reference - https://docs.qgis.org/2.18/en/docs/user_manual/introduction/qgis_configuration.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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