{"id":704077,"date":"2025-12-17T18:20:14","date_gmt":"2025-12-17T15:20:14","guid":{"rendered":"https:\/\/buradabiliyorum.com\/en\/google-clarifies-canonicalization-with-javascript\/"},"modified":"2025-12-17T18:20:14","modified_gmt":"2025-12-17T15:20:14","slug":"google-clarifies-canonicalization-with-javascript","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/google-clarifies-canonicalization-with-javascript\/","title":{"rendered":"Google clarifies canonicalization with JavaScript"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2e671cbc03d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2e671cbc03d\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/google-clarifies-canonicalization-with-javascript\/#Google_added_a_section_on_canonicalization_best_practices_for_JavaScript_to_the_JavaScript_SEO_best_practices_document\" >Google added a section on canonicalization best practices for JavaScript to the JavaScript SEO best practices document.<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"subhead\" itemprop=\"alternativeHeadline\"><span class=\"ez-toc-section\" id=\"Google_added_a_section_on_canonicalization_best_practices_for_JavaScript_to_the_JavaScript_SEO_best_practices_document\"><\/span>Google added a section on canonicalization best practices for JavaScript to the JavaScript SEO best practices document.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<div class=\"bialty-container\">\n<p>Google updated its Java<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">Script<\/a> SEO best practices document, for the second time this week, this time to clarify canonicalization best practices for JavaScript. In short, Google <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/developers.google.com\/search\/updates#clarifying-canonicalization-best-practices-for-javascript\">said<\/a> \u201csetting the canonical URL to the same URL as in the original HTML or if that isn\u2019t possible, to leave the canonical URL out of the original HTML.\u201d<\/p>\n<p><strong>What Google added. <\/strong>Google added a new <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/javascript\/javascript-seo-basics#canonical-links\">section over here<\/a> and it reads:<\/p>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u201cThe rel=\u201dcanonical\u201d link tag helps Google find the canonical version of a page. You can use JavaScript to set the canonical URL, but keep in mind that you shouldn\u2019t use JavaScript to change the canonical URL to something else than the URL you specified as the canonical URL in the original HTML. The best way to set the canonical URL is to use HTML, but if you have to use JavaScript, make sure that you always set the canonical URL to the same value as the original HTML. If you can\u2019t set the canonical URL in the HTML, then you can use JavaScript to set the canonical URL and leave it out of the original HTML.\u201d<\/p>\n<\/blockquote>\n<p><strong>Google on noindex. <\/strong>Google also warned about using JavaScript for noindex tags earlier this week. Google said \u201cyou do want the page indexed, don\u2019t use a noindex tag in the original page code.\u201d<\/p>\n<p><strong>Why we care. <\/strong>So if you use JavaScript for setting a canonical link, make sure to also check in Google Search Console\u2019s URL Inspection tool if it is being picked up. <\/p>\n<p>Review these updated best practices if you use JavaScript on your site, especially for canonical links. <\/p>\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMN63nwsw68G3Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/buradabiliyorum.com\/en\/category\/technology\/\" target=\"_blank\" >Technology<\/a><\/span> category.<\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/searchengineland.com\/google-clarifies-canonicalization-with-javascript-466366\" target=\"_blank\" >Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google added a section on canonicalization best practices for JavaScript to the JavaScript SEO best practices document. Google updated its JavaScript SEO best practices document, for the second time this week, this time to clarify canonicalization best practices for JavaScript. In short, Google said \u201csetting the canonical URL to the same URL as in the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":704078,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/searchengineland.com\/wp-content\/seloads\/2025\/12\/google-code-1920.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-704077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/704077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=704077"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/704077\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/704078"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=704077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=704077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=704077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}