1

I have a website and I changed the system from my previous web, but still with the same domain (eg: example.com). The web upgrade is complete and I want to have search engines index all page URLs on my website. I've submitted sitemap.xml to Google Search Console. But why only 1 URL is discovered? How do I get all my page URLs (articles, blogs, products, etc.) indexed?

enter image description here

sitemap.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://example.com/</loc>
    <lastmod>2018-06-04</lastmod>
  </url>
</urlset>
2
  • Is the sitemap you put into the question the full sitemap? It only has one URL in it. Dec 9, 2021 at 11:11
  • yeah, thats all my sitemap code. So, what should it be like? @StephenOstermiller
    – fikfe
    Dec 9, 2021 at 11:37

1 Answer 1

0

The XML sitemap you submitted to Google only has one URL in it. It shouldn't be a surprise that Google reports only discovering one URL in your sitemap. A sitemap should have multiple <url>s in it, one for each page on your site.

Google ignores the <lastmod> in XML sitemaps because very few sites keep it up to date appropriately. It is an optional field, and I recommend dropping it.

In the end, your sitemap should look more like:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>http://example.com/</loc></url>
<url><loc>http://example.com/page-one.html</loc></url>
<url><loc>http://example.com/page-two.html</loc></url>
<url><loc>http://example.com/page-three.html</loc></url>
</urlset>

XML sitemaps are limited to at most 50,000 URLs per file. Since your site has hundreds of thousands of URLs, you are going to need many XML sitemap files. You can either submit each of them separately or create a sitemap index file that lists all the sitemaps and submit the index. See Manage Large Or Multiple Sitemaps

It looks like you have submitted text sitemaps with all your URLs already. It isn't necessary to have both text and XML sitemaps. If your text sitemaps have all your URLs already, there is no need to submit an XML sitemap as well. If your text sitemap is out of date, it should be removed.

The other thing that you should know is that sitemaps have little bearing on which pages Google chooses to index or how the pages are ranked. See The Sitemap Paradox. If you want Google to index and rank all your pages, each page should have links pointing to it from other pages. That is a big part of why this site has the "related questions" section on this page.

If you recently changed all your URLs, you should redirect all your old URLs to their equivalent new URLs using "301 Permanent" type redirects. Using redirects is the best way to preserve rankings that your old pages had.

You can remove the old sitemap file from your server to remove it. Then Google will soon report "could not fetch" for that sitemap.

Removing old out-of-date sitemaps won't cause the URLs in them to get de-indexed. Sitemaps don't control which pages are indexed and Google typically indexes pages that are no longer in a sitemap. It would be a good idea to include any URLs from your old sitemap that are still good in your new sitemap.

The usual way to generate a sitemap for a large site is to query the database, make a list of pages from it, and write their URLs into a sitemap file. The specific mechanics of that depend on your site. If you are using an off-the-shelf content management system (CMS) there are likely existing tools or plugins that you can use to generate your sitemap. If you have a custom built site, you'll have to write your own sitemap generator.

4
  • I've seen the reference you gave. What I'm still confused about is, I have thousands of urls or even hundreds thousands, it seems it will be very difficult to implement one by one in sitemap.xml. Is there a way to generate all urls? And yes it is an old sitemap and a lot of incompatible urls. If I have to delete it, how do I do it in google search console? and when i delete the previous sitemap, will the indexed url also disappear from google search? sorry if i ask a lot
    – fikfe
    Dec 9, 2021 at 14:54
  • I added to the answer to address those questions. Dec 9, 2021 at 15:08
  • So, when I remove the previous sitemap from the server then the status in GSC will couldn't fetch? Then after that, all the urls in the sitemap_product.txt will disappear from google search? But the problem is, in the current project directory everything is the latest and nothing file/directory from the previous web exists. Like sitemap_product.txt, the project directory doesn't exist in the current project but why is in GSC still success instead of couldn't fetch? @StephenOstermiller
    – fikfe
    Dec 10, 2021 at 5:49
  • I wouldn't expect the URLs in the site map to get the index to Google when you remove the site map. If you'd already removed the site map it can take Google weeks or months to get around to checking it again. Dec 10, 2021 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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