Question

How do I delete images from the server? My droplet has been blocked for copyright infringement and can only be accessed by the console

Posted July 21, 2017 1.9k views
WordPressUbuntu 16.04

My droplet was blocked because it contained some images that I do not have copyright, these images were posted on my wordpress blog and now I have to remove them.

But as my droplet was blocked I can only access the console and I do not know the commands that I must type to be able to remove such images, could anyone help me?

Example of one of the images:

Https://myblog.com/wp-content/uploads/ANNBI-zoom-696x1088-1.jpg

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Searching the internet I found the command “ rm ” but I still could not remove

I tried the following on the console
 
rm ANNBI-zoom-696x1088-1.jpg

And it did not work,

So I tried

root@myblog: cd /var/www/html/wp-content/uploads

root@myblog: /var/www/html/wp-content/uploads# rm ANNBI-zoom-696x1088-1.jpg

And it did not work either.

what should I do?

Hi @fernando2i

This command will list files starting with ANNB in your WordPress uploads folder:

ls -l /var/www/html/wp-content/uploads/ANNB*

Otherwise try running this command, which will search for the file ANNBI-zoom-696x1088-1.jpg within your WordPress uploads and delete the file:

find /var/www/html/ -name "ANNBI-zoom-696x1088-1.jpg" -exec rm {} \;

It’s very important that you use big/small letters correctly.

@fernando2i

Yes, it shows all files starting with ANNB not ANNIB
But I guessed the other pictures starting with ANNB was also copyright infringements.

It might be easier if you just rename the upload folder, then tell support to get the droplet back online, and then use your regular file manager to delete all infringements before renaming upload folder back.

cd /var/www/html/wp-content/
mv uploads uploads2
Submit an Answer