3

The site I'm working on is a webshop type of site, and it can have any amount of products in it's database which are all categorized somehow and their categories can change, so based on a product's category they all have a long url so it's something like: example.com/category/category-name/product-name/p/id

The site is also set up in a way that example.com/p/id, would automatically 301 redirect to the full URL.

The problem with the long URLs is that I have to query the category for each product when generating the sitemap, and doing this with short links would be a way faster process because those only need product IDs.

When generating a sitemap, would it be ok to use the short links of a product instead of the long ones and would it affect SEO at all?

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
  • You shouldn't be using sitemaps to link to a page. Sitemaps are used to discover paths that are difficult for a search engine to discover on its own. – Rob Nov 05 '21 at 09:49
  • Most sources I find on sitemaps say that all pages should be included, so that search engines can crawl them efficiently. But there is a lot of conflicting information as well which kind of confuses me. – Krisztián Nagy Nov 05 '21 at 10:16
  • That's not true. If there is a link to a page, search engines will find the page on their own. My personal web site has no sitemap at all and Google found everything. – Rob Nov 05 '21 at 10:32
  • Yes for a small site that's true, but this site has over a million of products, so building a sitemap will for sure help it get indexed the most efficient way. – Krisztián Nagy Nov 05 '21 at 10:38
  • If you have links to the products then, no, you gain nothing with a sitemap and only waste your time doing what search engines do for themselves. – Rob Nov 05 '21 at 11:03
  • Even for big sites, sitemaps don't help URLs get indexed very much. Sitemaps can get Googlebot to come crawl all your URLs and it can give you extra stats in Google Search Console, but without links into pages, the pages usually don't have enough PageRank to warrant indexing, even if they are included in the sitemap. See The Sitemap Paradox – Stephen Ostermiller Nov 05 '21 at 11:04

1 Answers1

2

Your sitemap should not contain redirects. Just pick the URL that you want and don't try and get so many keywords into it with categories. Pick the URL structure you want and just use that.

keepkalm
  • 917
  • 4
  • 13