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?