How do I remove 'Places' entries from the Nautilus sidebar?

Tested in Ubuntu 14.04

Those bookmarks are controlled by ~/.config/user-dirs.dirs and commenting out a lines configures the appearance of the list

As an example, to remove the Videos bookmark from the list change the line:

XDG_VIDEOS_DIR="$HOME/Videos"

to

#XDG_VIDEOS_DIR="$HOME/Videos"

Note:
After login the file ~/.config/user-dirs.dirs gets reverted to the original set by /etc/xdg/user-dirs.defaults. To prevent that make the file "read-only" either by right clicking and then properties > permissions or using the command

chmod -w ~/.config/user-dirs.dirs

If you need to edit the file again do the opposite via Nautilus or use the command

chmod +w ~/.config/user-dirs.dirs

If you want to apply this to all users in your system change the file vim /etc/xdg/user-dirs.conf and set the option enabled to False. You need root permissions or this.


Open the file user-dirs.dirs in your ~/.config folder with your favorite text editor.

Comment out the line about the folder, which you do not want to be in the nautilus left pane. I commented about the Videos folder.

..........
..........
.........
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
#XDG_VIDEOS_DIR="$HOME/Videos"

Then open a terminal, and run xdg-user-dirs-gtk-update, see the magic.

for 13.04 or later:

In Nautilus >= 3.6 this will not survive a logout/login or reboot. To overcome this we have to point our XDG directories to "$HOME" like e.g.:

XDG_VIDEOS_DIR="$HOME"

Aha - the definitive answer, thanks to A. J. McMinn: Removing entries from Nautilus Places

1) Comment out the unwanted bookmarks in ~/.config/user-dirs.dirs

2) Make or edit a ~/.config/user-dirs.conf file and add the entry enabled=false.

This solution persists over boot.


*...this could be done with a one-liner: echo "enabled=false" > ~/.config/user-dirs.conf

Tags:

Nautilus