1

I'm new to SEO and not sure how exactly google crawler works

If I use the following format for URL:

example.com/category/id/name

The content of the page is loaded by only the id part, the other parts of URL are for SEO.

No matter what I put in category or name, the page will still load as far as the id is correct. How will this affect the googlebot's crawling? I only want it to index one id with it's correct category and name.

Does it help if I put one url in sitemap.xml for every id?


When I fetch data based on id, I can find the correct category and name. If I find they are not correct, I can setup a redirect:

if(url !== "example.com/incorrect-category/id/incorrect-name){
<script> window.location = "example.com/correct-category/id/correct-name" </script>
}

Will that help prevent googlebot crawling pages with the incorrect category and name? Is that the right way to do it?

1

I'd suggest you spend some more time reading URLs and SEO here, as I think you'll find many related questions and answers that you will find helpful.

Regarding googlebot, most URLs are found by crawling hyperlinks, not sitemaps (see The Sitemap Paradox). So, the question is, if you didn't have a sitemap, how would Google find your pages? How would Google know your ids to plug in to the URL? If you have links from other pages, you should be fine. However, if you don't have links from other pages, then the sitemap solution may be your only option.

Keep in mind, that the number of hops from your main page to your product page probably has a bigger impact on your SEO than anything else you have mentioned. If I have to hop through 3-4 pages to get to your id/name page, it will rank lower than if you have only one or two hops to get there.

| improve this answer | |
0

Having many URLs that all load the same content can be awful for SEO.

  • Googlebot may do far more crawling that it has to if it finds many URL variations
  • Google will find many pages on your site which look duplicate. That forces Google to exclude all the duplicates. Usually Google will choose one and discard the others.
  • If users link to different URLs for the same content, your link juice will be split between URL variations which can hurt search engine rankings.

Choosing a preferred URL and ensuring that search engines only find the the preferred URL is known as URL Canonicalization. There are several methods that can work:

  1. (Best method) Have your server issue "301 Permanent" redirects if the requested URL is not the preferred canonical.

  2. Use a tag in the <head> section of the page stating the preferred URL:

    <link rel="canonical" href="https://example.com/correct-category/id/correct-name">
    
  3. Create an XML sitemap that contains only the preferred URLs and submit that to search engines.

Your client side JavaScript method might also work, but I've never heard of another site doing that. I'm not sure if search engines would pick up on that signal or not.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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