Skip to main content
Blog|
How-to guides

How to add Google AdSense to WordPress

|
Jun 7, 2026|11 min read
HOW-TO GUIDESHow to add Google AdSense toWordPressHOSTNEYhostney.comJune 7, 2026

Short answer: Install the official Site Kit by Google plugin, connect it to your AdSense account, and let it place the AdSense code on every page for you. Then turn on Auto ads inside your AdSense dashboard so Google places ads automatically. That is the fastest path and it handles the verification snippet and your ads.txt file for you. If you want precise control over where each ad sits, use manual ad units pasted into Custom HTML blocks or widgets instead of, or alongside, Auto ads. Either way, your site has to be approved by AdSense first, and that approval depends on having real content and meeting Google’s program policies.

This guide walks through the whole flow: getting approved, the three ways to verify your site, placing ads with Auto ads or manual units, the performance cost of ad scripts and how to limit it, and where AMP fits in 2026.

Before you touch any code: get approved#

AdSense does not show ads on a site until Google has reviewed and approved it. There is no plugin or trick that skips this step. The review checks that your site has genuine, original content, working navigation, and complies with the AdSense program policies and Google Publisher Policies.

Practical things that get sites approved faster:

  • Real content on real pages. A handful of thin posts or a site that is mostly placeholders will be rejected. Have a body of finished articles or pages a visitor would actually read.
  • The required legal pages. A privacy policy is effectively mandatory because AdSense uses cookies. Most sites also add an about page and contact page.
  • A working, navigable site. Broken links, parked-domain pages, and under-construction notices are common rejection reasons.
  • You own the domain. You apply with the domain you publish on, not a free subdomain you do not control.

To apply, go to the AdSense site, sign in with a Google account, and add your site. Google gives you a code snippet at this point. You do not need to paste it by hand on WordPress. The plugin below does it for you, and that same snippet is what triggers the review.

Approval can take anywhere from a day to a couple of weeks. Until it lands, you can complete every step below, but the ad slots will simply stay blank.

The fast path: Site Kit by Google#

Site Kit is Google’s own WordPress plugin. It is the path Google itself recommends for AdSense, and it removes almost all of the manual work.

  1. In your WordPress dashboard, go to Plugins > Add new, search for Site Kit by Google, then click Install now and Activate.
  2. Click Start setup and sign in with the same Google account your AdSense application uses.
  3. In Site Kit, connect the AdSense service. Follow the prompts and allow Site Kit to place the AdSense code.

That is it. Site Kit injects the AdSense snippet into the head of every page, including the AMP version of your site if you run one. You can confirm it worked under Site Kit > Settings > AdSense, where it reports whether the code has been placed.

What Site Kit handles for you:

  • The verification snippet on every page, so Google’s review and ad serving both work.
  • Your ads.txt file. When Site Kit is connected to AdSense it verifies and manages ads.txt for you, which is the file that tells ad buyers you are an authorized seller of your inventory (more on this below).
  • AMP pages, if your site has them.

The one thing Site Kit does not do automatically is switch on Auto ads. It places the code; you still have to enable Auto ads in your AdSense account for ads to actually appear. That is the next section.

The three ways to verify your site#

“Verification” trips people up because there are a few different snippets that all get called the AdSense code. Here is what each one is and when you need it.

  • The AdSense code snippet (the main one). This is the script that both proves ownership for the review and, once Auto ads are on, places ads. Site Kit injects this for you. If you are not using Site Kit, you paste it into the head of your site yourself (see the manual header method below).
  • ads.txt. A plain text file at https://yourdomain.com/ads.txt listing the ad systems authorized to sell your inventory. Google strongly recommends every publisher have one because it protects your revenue from spoofed inventory. Site Kit manages it automatically. If you set it up by hand, AdSense gives you the exact line to put in the file, and you upload it to your site root.
  • The site verification meta tag (only if you verify through Search Console rather than the snippet). Most AdSense users never touch this because the main snippet already proves ownership.

Verifying without Site Kit (the manual header method)#

If you would rather not run Site Kit, you can paste the AdSense code into your site’s head section using a header-injection plugin. The right tool is something like WPCode (formerly Insert Headers and Footers) or your SEO plugin’s header field. The principle is the same one covered in how to add meta tags to your WordPress homepage: keep site-wide head code in a plugin, never hand-edited into header.php , because a theme update will silently wipe theme edits and your ads will stop serving.

To do it this way: copy the AdSense code from your AdSense dashboard, open your header-injection plugin, and paste the full snippet into the header ( wp_head ) slot so it loads on every page. Then create your ads.txt file manually and upload it to your site root via the file manager or FTP.

Auto ads vs manual ad units#

Once the code is on your site and AdSense has approved you, you choose how ads get placed. There are two models, and you can run both.

Auto ads#

Auto ads use a single code snippet (the one already on your site) and let Google scan each page and place ads where it predicts they will perform. You turn them on in your AdSense account under Ads > By site, then toggle Auto ads on for your domain.

Auto ads can place several format families:

  • Intent-driven: in-content links, anchors, and chips woven into your existing text.
  • Overlay: anchor ads stuck to the top or bottom of the screen, full-screen vignettes between page views, and side rails on wide screens.
  • In-page: standard banners, multiplex (native grid) units, and related-search blocks.

You keep meaningful control even with Auto ads on. In the AdSense Auto ads settings you can exclude specific pages, exclude areas of a page from in-page placements, cap how often vignettes show, and turn individual formats on or off. If your articles suddenly sprouted an annoying full-screen ad, the vignette toggle is where you tame it.

Use Auto ads if you want the least work, you do not have strong opinions about ad placement, or you are just getting started and want to see what earns before you fine-tune.

Manual ad units#

Manual ad units are individual ad slots you create in AdSense and place yourself. In AdSense you go to Ads > By ad unit, create a display unit, and copy its code. Then you place that code where you want it on WordPress:

  • In a post or page: drop a Custom HTML block where the ad should appear and paste the unit code. This is the same block covered in how to add HTML to a WordPress post or page, and it renders the ad code exactly as pasted.
  • In a sidebar or footer: add the ad code to a widget area. A Custom HTML widget works, and if you want a reusable, conditionally placed ad slot, see how to create a custom WordPress widget.
  • Site-wide in a fixed spot (for example after every post’s content): a plugin like Advanced Ads or Ad Inserter handles placement rules so you are not editing every post.

Use manual units if you want exact control over which ads appear where, you are matching ads to a specific layout, or Auto ads placed something in a spot that hurt your reading experience or your Core Web Vitals.

You can mix both. A common setup is Auto ads on for broad coverage, plus one or two manual units in the exact spots you care about. AdSense’s Auto ads are designed to detect your existing units and avoid stacking ads on top of each other.

The performance cost, and how to limit it#

This is the part most AdSense guides skip. Ad code is heavy third-party JavaScript, and it loads from Google’s servers on every page view. Left unmanaged, it is one of the most common reasons a fast WordPress site starts failing its Core Web Vitals.

The two metrics ads hurt most:

  • CLS (Cumulative Layout Shift). Ads that load after the page has rendered shove your content down, and that layout jump is exactly what CLS measures. Reserve space for each ad slot so the page does not reflow when the ad arrives.
  • INP (Interaction to Next Paint). Ad scripts run on the main thread and can make taps and clicks feel laggy while they execute.

Ways to keep ads from wrecking your speed:

  • Reserve the ad space. Give each ad slot a fixed minimum height in CSS so the slot holds its place before the ad loads. This is the single biggest CLS fix for ad-heavy pages.
  • Lazy-load below-the-fold ads. Ads further down the page do not need to load until the visitor scrolls near them. Auto ads handle a lot of this for you, and most ad-management plugins offer a lazy-load toggle for manual units. The same lazy-loading principle from how to speed up WordPress applies to ads.
  • Do not overload the page. More ad units mean more requests and more script execution. Density past a certain point both slows the page and, beyond AdSense’s own limits, risks a policy strike.
  • Audit your other third-party scripts too. AdSense rarely loads alone. Stacked with analytics, a pixel, a chat widget, and a tag manager, the combined third-party weight is what actually drags the site down. If ads pushed you over the edge, the why is my WordPress site so slow diagnostic guide walks through finding the culprits.

The honest trade-off: every ad you add costs some page speed. The goal is not zero ads, it is putting ads only where they earn enough to justify the weight, and reserving their space so they do not jolt the layout.

What about AMP?#

AMP (Accelerated Mobile Pages) still works with AdSense. Auto ads for AMP and the amp-ad component are both supported, and if you run Site Kit it places the ad code on your AMP pages automatically. So if you already have AMP, AdSense will serve on it without extra work.

The more useful 2026 answer is that AMP has faded. Google removed the ranking and Top Stories advantages that made AMP worth the maintenance, and many sites have retired their AMP versions to serve a single, fast, modern responsive site instead. If you are not already committed to AMP, there is little reason to add it just for ads. A well-built responsive site that passes Core Web Vitals serves AdSense fine on mobile without a separate AMP layer to maintain.

Common mistakes#

  • Pasting the AdSense code into header.php . A theme update overwrites the file and your ads quietly stop. Use Site Kit or a header-injection plugin so the code survives theme changes.
  • Expecting ads immediately after install. Nothing shows until AdSense approves the site, and approval can take days. A blank slot during review is normal.
  • Forgetting to enable Auto ads. Site Kit places the code but does not flip Auto ads on. If the code is verified but no ads appear, check the Auto ads toggle in AdSense.
  • No ads.txt file. Without one, some buyers will not bid on your inventory and you leave money on the table. Let Site Kit manage it, or create it by hand from the line AdSense gives you.
  • Cramming in ad units. Too many ads slows the page, annoys readers, and can trip AdSense’s policy limits. Start light and add only where it earns.
  • Ignoring layout shift. Ads that load with no reserved space tank your CLS score. Reserve the slot height up front.
  • Running two ad plugins that both inject code. Pick one placement method. Auto ads plus a single manual approach is fine; two competing auto-injectors will double up and break things.
  • Clicking your own ads to test. This violates AdSense policy and can get your account banned. Use AdSense’s own preview and reporting instead.

Summary#

Adding AdSense to WordPress comes down to four moves: get your site approved, get the code onto every page (Site Kit is the easy way and it handles ads.txt for you), choose Auto ads for hands-off placement or manual units for control, and manage the performance cost so the ad scripts do not wreck your speed.

Quick recap:

  • Approval first. Real content, a privacy policy, a navigable site, your own domain.
  • Site Kit places the code, manages ads.txt, and covers AMP pages. It does not auto-enable Auto ads.
  • Auto ads = one snippet, Google places, you exclude pages and formats as needed.
  • Manual units = your own slots in Custom HTML blocks, widgets, or via an ad plugin.
  • Reserve ad space and lazy-load below-the-fold ads to protect CLS and INP.
  • AMP still works, but AMP itself has faded; a fast responsive site is the simpler 2026 default.