Block wp-content/uploads folders

Trying to block the wp-content/uploads folder from being accessed publically, so that people can’t see your media?

htaccess solution

A very simple solution is to simply add the following line at the very end of your .htaccess file.

Options -Indexes

This way, it forbids visitors from accessing the wp-content/uploads directories accordingly.

Extra security: Scramble file upload names

For further protection, you could consider scrambling file names with an MD5 encryption automatically within WordPress, using the methods outlined in that guide.

There’s also a Random File Upload Names plugin that you could use.