I am having trouble with a few image files that I would like to block for Google Image search. I am using Yoast SEO Plugin, which allows me to directly edit the robots.txt file.

A few people with portrait images on the site requested not to appear in image search, so we added entries like the following:

User-Agent: Googlebot-Image
Disallow: /wp-content/uploads/2019/03/domain.eu-adam.png
Disallow: /wp-content/uploads/2020/02/domain.eu-team-eve.jpg

Some time later, we noticed that this is not working anymore, as the images started to reappear on Images results. This may in part be caused by new photos being used with different filenames, but even after updating the file again, deleting the older image files, and giving the Google Indexer some time, Google displays the images. (latest robots.txt update was in May)

Opening domain.eu/robots.txt displays the latest version. Is there some kind of Google or WordPress magic that I am missing?

1 Answer 1


This took the index some more time, but after around six weeks, the blocked images are no longer displayed as search results.

I am not sure if this will help for future uploads for photos of the same people with different filenames, but I had added strings with placeholders like these:

User-Agent: Googlebot-Image
Disallow: /wp-content/uploads/*adam*smith*.jpg
Disallow: /wp-content/uploads/*adam*smith*.png
Disallow: /wp-content/uploads/*eve*miller*.jpg
Disallow: /wp-content/uploads/*eve*miller*.png
Disallow: /wp-content/uploads/2019/03/domain.eu-adam-smith.png
Disallow: /wp-content/uploads/2020/02/domain.eu-team-eve-miller.jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.