I developed my website under /var/www/html (for the development part) so I can consult the website when I enter the server's IP address into my web browser. On the same server I have the same products under /var/www/example.com and it's this domain than I want indexed on Google.

My problem is that Google has indexed both. So sometimes the goods appears in Google with example.com and sometimes Google displays the IP address of the server.

So I added meta robots noindex nofollow, and also disallow: / into robot.txt to remove the IP address version of the site from Google search console. However, the IP address was still showing up in Google. So I decided to remove completely all files under /var/www/html and left just the nginx html page. However, I still have the same problem. The IP address is always displayed in Google. I noticed than the meta description is ignored too. Google takes the old description.

Can you tell me if I did something wrong or what I have to do to remove this IP from google search. How long do we need to wait to see changes?

  • 1
    If you disallow in robots.txt then Google can't see your meta tags. Only do the meta and then wait a month. – Stephen Ostermiller Nov 24 at 10:32
  • Oh ok so I did a mistake :/ I'll remember for the next time. If I deleted all project inside /var/www/html it's fine too ? – John Nov 24 at 10:57
  • When you remove the files, is your site unavailable at the IP address? If so, that should work. Again you need to wait a month or two for Google to fully re-crawl the whole site at the IP address and realize it is gone. – Stephen Ostermiller Nov 24 at 11:44
  • I'll not see the site because I removed all html css and js files. I just let nginx html page. – John Nov 24 at 11:51
  • You can request URL removal from Search Console (Formerly, Google Webmaster Tools). – zipkundan Nov 26 at 5:49

Use canonical meta tags on each of your pages, specifying to search engines that your domain name is the version of the site you want indexed.

<link rel="canonical" href="https://example.com/your/page/path/" />

More info:

https://moz.com/learn/seo/canonicalization

https://support.google.com/webmasters/answer/139066?hl=en

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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