I am trying to block images from google image search, but for some reason they are not working. I have a Wordpress self-hosted blog and I have full access to the backend. HTML of
mydomain.com looks like below:
<a href="mydomain.com/image.png" data-id="4989" rel="nofollow" aria-label="open this media" data-type="image" class="fg-thumb"> <span class="fg-image-wrap"> <img width="288" height="384" class="skip-lazy fg-image" role="presentation" data-src-fg="mydomain.com/image_thumbnail.png" src="mydomain.com/image_thumbnail.png" loading="eager"> </span> </a>
Google image search using the query
site:mydomain.com shows both
mydomain.com/image_thumbnail.png pointing to
mydomain.com. I am trying to remove these image entries from showing up on image search results.
I am aware of Google Search Console removal and it is not a solution I am looking for.
On my NGINX backend, the
png files are being served with the header
x-robots-tag: noindex. Image files are not being blocked by
robots.txt so that the crawlers can see the header, which I think is how it should be done.
So far the above implementation is not working in preventing the images from showing up on Google image search. I have almost ruled out cache issues, because
mydomain.com renders dynamically showing random images and new images keep popping up on image search. (UPDATE: It looks like there is a cache issue. I am not using any CDN. After updating
mydomain.com to use only a few images, images that are not used still pop up in google image search.)
mydomain.com does not have
<meta name="robots" content="noindex">, and should not have it because
mydomain.com needs to be indexed.
Any help or pointers would be appreciated.