With the simple rug glitch, you can keep your settlement abode NPC free.
You need to build a door and put a door inside it. Close out of workshop mode, open the door, then go back into workshop mode.
Next, lay down a small floor, then lay down a mat. Once you've lined up the mat to your liking, use a long press (X on PS4) to select all items. Take your doorframe to your structure (I'm using Sanctuary as an example) and line up the open door in the doorway so it looks closed (I didn't line my door up as well as I could have in the video).
Since the door looks "open" to NPCs, they don't try to open the "closed" door and can't go through it.
As far as I know, this still works with the new update (though I haven't updated my game to the new update to confirm).
Hat tip to Redditor SymbolicGamer ([ Ссылка ]) for the tip. I just made the video.
![](https://s2.save4k.ru/pic/Cm_nrzdC6EY/maxresdefault.jpg)