Home > database >  prevent Google from indexing VM's external IP
prevent Google from indexing VM's external IP

Time:06-17

My setup:

  • Bitnami Wordpress
  • GCP VM
  • GCP HTTPs Load Balancer
  • Load Balancer has http to https redirection, www to non-www redirection
  • Cloud CDN

Main Problem:

The VM's external IP (22.22.22.22) is indexed by Google Search. I'm unable to remove it from Google Search because it is not recognized as a property that belongs to me and the indexed page (http://22.22.22.22/home) is live. http://22.22.22.22/home is resolved to example.com which is a live page.

what I have checked

  • The domain name and Load Balancer's IP is properly resolved
  • No new mod_rewrite rules other than those from the default installation
  • The site does not have any reference to VM's external IP, including database
  • No cache plugins installed
  • Wordpress's site address and home address is pointing to http://example.com

what I have done to rectify

I've added 301 redirects which I'm not sure if that helps. It will take some time to check if that works.

My questions

  1. Is there a way to prevent Google from indexing IPs(Any IPs in general)?
  2. How to prevent VM's ext. IP from being indexed by Google especially when load balancer is in use?

CodePudding user response:

There is a simple solution but it takes time. Configure the Apache web server to redirect IP-based queries to your domain or return an error. Google Search will eventually notice the redirect and remove the IP address from search queries.

For redirects, use a permanent redirect (301).

301 Moved Permanently

How To Create Temporary and Permanent Redirects with Apache and Nginx

There are WordPress plugins to do the same, but I prefer to configure Apache directly and not add another plugin to a site.

Is there a way to prevent Google from indexing IPs(Any IPs in general)?

No, Google can index any site, IP or Hostname based, that is public unless restricted via robots.txt.

Introduction to robots.txt

How to prevent VM's ext. IP from being indexed by Google especially when load balancer is in use?

You can create a VPC Firewall rule that only allows traffic from the load balancer and blocks Internet ingress traffic.

Load Balancer Firewall Rules

Additional information:

Remove a page hosted on your site from Google

  • Related