Adding Google AdSense to a WordPress site takes about 15 minutes once your account is approved. The easiest way is Google's free Site Kit plugin, which places the code for you. This guide covers Site Kit, the manual method, ads.txt and the settings that make a real difference to earnings.
Short version: get your site approved in AdSense, install Site Kit by Google, connect AdSense, let Site Kit place the code, then turn on Auto ads in your AdSense account. Check that your ads.txt file is live and, if you have visitors in Europe, set up a Google-certified consent message first.
Before you start
- An approved AdSense account with your site added. Not approved yet? Use our AdSense readiness checker and see how to apply for AdSense.
- Administrator access to WordPress.
- A privacy policy page, and a consent tool if you have visitors from the EEA, UK or Switzerland. Read do I need a CMP.
Method 1: Site Kit by Google (recommended)
- In WordPress go to Plugins, then Add New, and search for Site Kit by Google. Install and activate it.
- Click Start setup and sign in with the Google account that owns your AdSense account.
- In Site Kit, open Settings and click Connect service next to AdSense.
- Let Site Kit place the AdSense code on your site. Google recommends this, and it works on normal and AMP pages.
- In your AdSense account, go to Ads and turn on Auto ads for your site. Site Kit cannot change AdSense settings for you, and without Auto ads or ad units no ads appear.
If you have visitors in Europe, Google suggests not showing ads straight away, so you can set up a consent message first.
Method 2: Add the code yourself
- In AdSense, go to Ads, then By site, and copy the AdSense code.
- Paste it into the
<head>of your site, using your theme's header settings or a header and footer plugin. Avoid editing theme files directly, as theme updates overwrite them. - Turn on Auto ads, or create ad units and place them with a block, widget or ad plugin.
Auto ads or manual ad units?
| Auto ads | Manual ad units | |
|---|---|---|
| Setup | One switch, Google chooses places | You choose every place |
| Control | Limited: formats, ad load, excluded pages | Full control over position and size |
| Best for | New sites and busy owners | Sites that want to test layouts |
| Risk | Can place too many ads on some pages | Takes time to set up well |
Many sites combine both: Auto ads for anchors and vignettes, manual units inside the content. See how to place AdSense ads and where to place ads on a website.
Don't forget ads.txt
AdSense shows an "Earnings at risk" warning if your ads.txt file is missing. It is one line in a text file at yourdomain.com/ads.txt:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Replace the zeros with your own publisher ID from AdSense. Many SEO and ad plugins can create the file for you. Check it with our ads.txt checker or build one with the ads.txt generator.
Ads not showing? Check this
- Site Kit shows "Code has been placed".
- Your site is listed and approved on the Sites page in AdSense.
- Auto ads are on, or you have placed ad units.
- You waited up to an hour after setup.
- Your ad blocker is off when you test.
- No caching or optimisation plugin is delaying or removing the AdSense script.
Frequently asked questions
How do I add AdSense to WordPress?
Install the free Site Kit by Google plugin, connect AdSense, let Site Kit place the code and turn on Auto ads in your AdSense account. You can also paste the AdSense code into your site's head section yourself.
Do I need a plugin for AdSense on WordPress?
No, but it is easier. Site Kit by Google places the code for you. Without a plugin, you can add the code to your theme's header settings.
Why are my AdSense ads not showing on WordPress?
Check that the code is placed, your site is approved, Auto ads or ad units are turned on, and no caching or optimisation plugin is blocking the AdSense script. New setups can take up to an hour.
Do I need ads.txt for AdSense on WordPress?
Yes. Without it AdSense shows an earnings at risk warning. Add one line with your publisher ID to an ads.txt file in your site's root.
Sources
Updated December 2, 2026.



