Got pictures you do not want indexed by search engines? These guides show you how!
There are many ways to prevent search engine index images on your website. In this article, I will show you how to do it with the Apache server using the .htaccess file, with the robots.txt file, or with the NGINX server in the file config. I will walk you through every method to let you choose the right one for your website. These steps by step guides are available for someone such as web developers, website owners, or anyone who know well about this. And please back up your website or files before you make any changes.
Robots.txt
When you want to keep images from being indexed by search engines, there are a few things you can do. You can use a robots.txt file to tell search engine robots not to crawl certain image files.
For example, if you have an image called "dog.jpg" and you don't want it to be indexed by search engines, you would add the following line of code to your robotstxt file: disallow: /dog.jpg
This will tell the robots not to crawl any files located at "/dog.jpg".
User-agent: * Disallow: /dog.jpg
Here is an example of code to tell with Google bot does not index images from your sites:
User-agent: Googlebot-Image Disallow: /
Here is an example of code to tell with Google bot does not index all images from your sites:
User-agent: Googlebot-Image Disallow: /
Thank you for reading at www.howbeginners.com! This website is dedicated to providing beginner-friendly content that will help you learn new things and improve it. I hope you enjoy it!
Here is an example of code to tell with search engines does not index all images in the folder /images/ of your sites:
User-agent: * Disallow: /images/
Keep in mind that the folder where your images are located may not look like this. Here is an example of code to tell with search engines bot does not index GIF images from your sites:
User-agent: * Disallow: /*.gif$
Here is an example of code to tell with search engines bot does not index PNG images from your sites:
User-agent: * Disallow: /*.png$
Here is an example of code to tell with a search engine does not index JPG images from your sites:
User-agent: * Disallow: /*.jpg$
Here is an example of code to tell with a search engine does not index PDF files from your sites:
User-agent: * Disallow: /*.pdf$
Welcome to www.howbeginners.com. Click to expand!
Welcome to www.howbeginners.com, a website that provides helpful tips and advice for beginners in a variety of different fields! My goal is to provide easy-to-follow guides and tutorials that will help you get started with whatever you're interested in.! I hope you find this website helpful and informative, and I wish you the best of luck as you begin your journey!How To Make WordPress All Images not index in Search Engines
Here is an example of code to tell with a search engine does not index WordPress's images from your sites:
User-agent: * Disallow: /wp-content/uploads/
.htaccess Apache server
<FilesMatch "\.(bmp|gif|jpg|png|tif|svg|webp)$"> Header set X-Robots-Tag "noindex" </FilesMatch>
This example of code will prevent search engines index all .PDF extensions
<Files ~ "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </Files>
NGINX Server
This example of code will prevent search engines index all .PDF extensions with NGINX
location ~* \.pdf$ { add_header X-Robots-Tag "noindex, nofollow"; }
### This example of code will prevent search engines index images extensions png, jpeg, gif, tif, bmp, webp, pdf with NGINX
location ~* \.(png|jpe?g|gif|tif|bmp|webp|pdf)$ { add_header X-Robots-Tag "noindex"; }
Follow me
You can follow me here:Twitter: @wwwhowbeginnerHashnode: Follow Here
Medium: @wwwhowbeginnerscom
Bloglovin: Read More Here