Website doesn't show in Google search

Hi All,
I created a personal website several months ago, but I can’t get any search results for my website. Any idea how I can improve this? The website is https://weilongsites.netlify.app/. I don’t have my own domain, so I am using the domain “netlify.app” provided by Netlify directly.

Thanks!

Have you submitted your website to Google to index? Google Search Console

1 Like

Hi, thanks for the reply. I did try to submit to Google to index, but I have no idea where I should put the HTML file to Netlify. Any idea where I should upload that file? Thanks!

@Weilong Welcome to the Netlify community.

You don’t use an HTML file for your sitemap. You can use a sitemap.txt file, which is basically a text file with a listing of all the URLs in your site, or you can use a sitemap.xml file, which is a specially-formatted file with more information.

The TXT version should be easy to generate. The XML version requires special construction.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.example.net/?id=who</loc>
    <lastmod>2009-09-22</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>http://www.example.net/?id=what</loc>
    <lastmod>2009-09-22</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.5</priority>
  </url>
  <url>
    <loc>http://www.example.net/?id=how</loc>
    <lastmod>2009-09-22</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.5</priority>
  </url>
</urlset>

You can build it yourself or use one of the many free online generators or use the Netlify plugin (assuming you can figure out how to set it up), etc.

Either way, you then include the path to your sitemap in your robots.txt file, and register your sitemap file with Google, Bing, etc.

For more information, see:

Thanks for the reply. But I still have some problems to solve this.

  1. It seems that I need to verify the domain before submitting a sitemap to Google. Any idea which method I should choose?
  2. I think I can generate .XML file using some online generator. After I get the file, where should I put under my Github repository? I don’t have robots.txt. Here is the list I have.
    Thanks a lot!

You can choose any method (except for DNS). It seems like, you’ve already uploaded the HTML file. That should do it. Once the website is published, tell Google to check for the file and you’re done.

@Weilong I don’t understand your workflow, but there is almost certainly a folder where you can put assets that are passed along to the final build without being changed. Chose the HTML file option and put the file Google gives you there. That’s where the robots.txt file can go, too. If your build process does not generate a robots.txt file, simply create one, and populate it with the correct directives. That’s also where you should place any pre-generated sitemap.xml file. Then register that file in your Google webmaster dashboard. Don’t expect Google to recognize your site immediately, though, unless you have a bunch of traffic.

Thanks for the reply. I did upload the HTML file to the Github repository. But this is the error message I got, did I put it under the wrong folder?

Are you sure you’ve uploaded the correct file (and the site is live)? I tried visiting this URL: https://weilongsites.netlify.app/googledfb3f973d721b24a.html (I got the filename from the screenshot you provided above) and I’m getting Error 404. The file that you’ve added should not be renamed or edited in any manner. If you’re sure, tell Netlify to publish your website so that the changes go live and the link I mentioned should show some text on the page instead of the 404 page. If it’s working, tell Google to rescan the HTML file and it will work.

Thanks. I did upload exactly the same file and Netlify did publish my website.


But I still got the same error from Google. That’s why I am thinking maybe I should put the HTML file in a different folder? Thanks.

Ahh, my bad, I didn’t see that you’re using some website generator. Well, in that case, you might need to upload the file in your ‘static’ folder. That should do it.

Thanks a lot! This works. Should I also put the .XML file in the ‘static’ folder and submit the sitemap through Google?

All the files that should exist in the root (that is, yourdomain.com/<filename>) of your website are supposed to go in static folder.

With that being said, just adding the file to the static folder won’t work and you’d have to manually submit the sitemap.xml file to Google. For further details on how to do that, I’d suggest you search on the internet for Google Search Console tutorials.