As I know for now there is no any feature to do that in intellij idea. I dont know why but they dont support to do that, at least this is the result which I found with all my re
Closing unused modules in intellij idea like in eclipse?
You can make that module directory as excluded from that project.
Right clicked on the directory, then goto Mark Directory As
-> then click Excluded
it
To Add a module back, click on Project Structure
button, then goto Modules
section, then you can add them back