{"id":34613,"date":"2013-07-12T11:51:58","date_gmt":"2013-07-12T06:21:58","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=34613"},"modified":"2026-10-07T20:01:28","modified_gmt":"2026-10-07T14:31:28","slug":"load-google-adsense-script-once","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/","title":{"rendered":"Load the AdSense Script Once for Multiple Ads (Faster Pages)"},"content":{"rendered":"<p>Do you <strong>load the AdSense script once<\/strong> per page, or does every ad unit load its own copy? When Google introduced the asynchronous AdSense code in 2013, Michael Kleber of Google&#8217;s ads latency team explained that the adsbygoogle.js script &#8220;only needs to appear once on your page, even if you have multiple ads&#8221;. Loading it repeatedly adds no benefit and slows the page. Here is how to set it up correctly in 2026.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-34617\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/confirm-code.png\" alt=\"load AdSense script once confirmed\" width=\"484\" height=\"283\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/confirm-code.png 484w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/confirm-code-300x175.png 300w\" sizes=\"(max-width: 484px) 100vw, 484px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Put the AdSense script <code>&lt;script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-XXXX\" crossorigin=\"anonymous\"&gt;&lt;\/script&gt;<\/code> once in your page head. Then, for every ad unit, paste only the <code>&lt;ins class=\"adsbygoogle\"&gt;<\/code> tag and its push line, and delete the duplicate script line that comes with each unit&#8217;s code.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 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-6aee0e9854ced\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" 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: #1a202c;color:#1a202c\" 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-6aee0e9854ced\" 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:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Why_load_the_AdSense_script_only_once\" >Why load the AdSense script only once?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#How_each_AdSense_units_code_is_built\" >How each AdSense unit&#8217;s code is built<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#How_to_load_the_AdSense_script_once\" >How to load the AdSense script once<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#What_if_I_use_Auto_ads_and_manual_ads_together\" >What if I use Auto ads and manual ads together?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Using_WordPress_ad_plugins\" >Using WordPress ad plugins<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Troubleshooting\" >Troubleshooting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#How_much_faster_is_it\" >How much faster is it?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Can_I_really_use_one_AdSense_script_for_many_ads\" >Can I really use one AdSense script for many ads?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Does_loading_the_script_twice_cause_problems\" >Does loading the script twice cause problems?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/load-google-adsense-script-once\/#Where_should_the_AdSense_script_go\" >Where should the AdSense script go?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_load_the_AdSense_script_only_once\"><\/span>Why load the AdSense script only once?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Faster pages:<\/strong> the browser checks the same script again for each copy, adding work on every page view.<\/li>\n<li><strong>Cleaner code:<\/strong> one script in the head is easier to manage, update and audit.<\/li>\n<li><strong>Officially supported:<\/strong> Google&#8217;s own Auto ads code uses exactly this setup, a single head script for the whole page.<\/li>\n<\/ul>\n<p>It also helps your <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/05\/core-web-vitals\/\">Core Web Vitals<\/a> and scores in our favourite <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2015\/02\/best-web-page-speed-tests-online\/\">web page speed tests<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_each_AdSense_units_code_is_built\"><\/span>How each AdSense unit&#8217;s code is built<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Every display ad unit you copy from <a href=\"https:\/\/adsense.google.com\/\" target=\"_blank\" rel=\"noopener\">Google AdSense<\/a> has three parts:<\/p>\n<pre><code>&lt;!-- 1. The script (needed only once per page) --&gt;\r\n&lt;script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-1234567890\" crossorigin=\"anonymous\"&gt;&lt;\/script&gt;\r\n\r\n&lt;!-- 2. The ad slot --&gt;\r\n&lt;ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1234567890\" data-ad-slot=\"4538312732\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"&gt;&lt;\/ins&gt;\r\n\r\n&lt;!-- 3. The push call (needed for every ad slot) --&gt;\r\n&lt;script&gt;(adsbygoogle = window.adsbygoogle || []).push({});&lt;\/script&gt;<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"How_to_load_the_AdSense_script_once\"><\/span>How to load the AdSense script once<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Copy part 1, the <code>adsbygoogle.js<\/code> script line, into your site&#8217;s <code>&lt;head&gt;<\/code>. In WordPress use your theme&#8217;s header scripts box, Site Kit by Google, or an ad plugin&#8217;s global code setting.<\/li>\n<li>For each ad unit, paste only parts 2 and 3 where the ad should appear.<\/li>\n<li>Remove extra copies of the script line from widgets, theme hooks and ad plugins.<\/li>\n<li>Clear your cache and view the page source (Ctrl+U). Search for &#8220;adsbygoogle.js&#8221;; it should appear once.<\/li>\n<\/ol>\n<p>Never edit the ad slot attributes beyond what AdSense allows. Avoid the other <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2005\/05\/15-common-mistakes-by-google-adsense-publishers\/\">common AdSense mistakes<\/a> too.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_if_I_use_Auto_ads_and_manual_ads_together\"><\/span>What if I use Auto ads and manual ads together?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Auto ads use the same head script, so you still need it only once. Your manual ad units then need just the ins tag and push line. See <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2022\/12\/using-adsense-auto-ads\/\">using AdSense Auto ads<\/a> for how they combine.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Using_WordPress_ad_plugins\"><\/span>Using WordPress ad plugins<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Most good ad plugins, such as Advanced Ads and Ad Inserter, have a setting to add the AdSense script once globally and strip it from individual ads. Check that only one plugin, or your theme, adds it. Our guide to the best <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/11\/10-best-wordpress-plugins-for-google-adsense\/\">WordPress plugins for AdSense<\/a> compares them.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Troubleshooting\"><\/span>Troubleshooting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Ads not showing after removing duplicates:<\/strong> make sure the head script is still present and that each ad has its own push line.<\/li>\n<li><strong>Script in the footer:<\/strong> it works, but placing it in the head lets ads start loading sooner without blocking the page, because it is async.<\/li>\n<li><strong>Old HTTP code:<\/strong> replace any http:\/\/ script URLs with https:\/\/.<\/li>\n<\/ul>\n<p>For the full background on async loading, read our guide to the <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/06\/google-adsense-asynchronous-code\/\">AdSense asynchronous code<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_much_faster_is_it\"><\/span>How much faster is it?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>On a page with three or four ad units, removing duplicate script tags will not transform your speed score by itself, but it removes needless work from every page view, and these small wins add up across a whole site. Combine it with reserving space for each ad, lazy loading images below the fold and trimming unused plugins, and pages feel noticeably snappier, especially on phones over mobile data.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_really_use_one_AdSense_script_for_many_ads\"><\/span>Can I really use one AdSense script for many ads?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. One adsbygoogle.js script serves every ad unit on the page; each unit needs its own ins tag and push call.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_loading_the_script_twice_cause_problems\"><\/span>Does loading the script twice cause problems?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually ads still show, but it wastes resources and can cause warnings in testing tools.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Where_should_the_AdSense_script_go\"><\/span>Where should the AdSense script go?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Google recommends the head section of every page where you show ads.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you load the AdSense script once per page, or does every ad unit load its own copy? When Google&#8230;<\/p>\n","protected":false},"author":4,"featured_media":34617,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[43,6],"tags":[13,49],"class_list":["post-34613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advertising","category-blogging","tag-adsense","tag-tutorials"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/34613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=34613"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/34613\/revisions"}],"predecessor-version":[{"id":63518,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/34613\/revisions\/63518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/34617"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=34613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=34613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=34613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}