How to Add Google AdSense to Your Website

Ads only show after Google approves the site. Sign up for AdSense, add your site, paste the AdSense code between the head tags of every page, and publish an ads.txt file at your domain's root with the line AdSense gives you. Review usually takes a few days and can take 2 to 4 weeks.

What AdSense asks for before approval
RequirementDetail
AgeAt least 18, or a parent or guardian applies
ContentOriginal content that follows AdSense policies
AccessYou can edit and view the site's HTML
ads.txtYour publisher line at yourdomain.com/ads.txt

Updated

AdSense pays for ad space on pages people already visit, so it rewards sites with steady traffic and useful content. A brand-new site with a few pages is more likely to be told it needs more content than to be approved.

Add AdSense on We.Inc, WordPress, Wix, Squarespace or plain HTML

We.Inc

  1. Connect a custom domain to your site (needs Starter or higher).
  2. AdSense is not an add-on: in the AI chat, paste your AdSense code and ask for it in the head of every page.
  3. In the same chat, ask for an ads.txt file at the site root containing your AdSense line.
  4. Publish, open yourdomain.com/ads.txt to check it, then request review in AdSense.

Placing AdSense code through the AI chat spends credits, which come with paid plans.

WordPress

  1. Install Site Kit by Google from Plugins, Add Plugin, and connect AdSense; it can place the code for you.
  2. Or paste the AdSense code into a header code plugin.
  3. Upload ads.txt to the site root, or use a plugin that serves it.

Site Kit and other plugins only install on paid WordPress.com plans.

Wix

  1. Add the AdSense code through Settings, Custom Code, in the Head of all pages.
  2. Add your AdSense publisher line using Wix's ads.txt feature in the dashboard (see Wix's ads.txt help article).
  3. Publish and request review.

Custom code requires a premium plan and a connected domain.

Squarespace

  1. Paste the AdSense code into Code Injection, Header.
  2. Save and publish.

Code Injection is on Core, Plus and Advanced plans only. Squarespace does not let you upload a file to the site root, so serving ads.txt there needs a workaround; check Squarespace's current help pages before applying.

Plain HTML

  1. Paste the AdSense code in <head> on each page.
  2. Create ads.txt with your line and upload it to the web root.
  3. Deploy and request review.

An ads.txt line for AdSense

Use the exact line from your AdSense account; your publisher ID replaces the placeholder.

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Sources

  • Google AdSense Help, connect your site to AdSense: https://support.google.com/adsense/answer/7584263 (checked October 28, 2026, used for the AdSense steps)
  • Google AdSense Help, eligibility requirements: https://support.google.com/adsense/answer/9724 (checked October 28, 2026, used for the AdSense steps)
  • Wix Help Center, add an ads.txt file: https://support.wix.com/en/article/add-an-adstxt-file-to-your-wix-site (checked October 28, 2026, used for the AdSense steps)
  • Wix Help Center, embedding custom code: https://support.wix.com/en/article/embedding-custom-code-on-your-site (checked October 28, 2026, used for the AdSense steps)
  • Squarespace Help Center, using code injection: https://support.squarespace.com/hc/en-us/articles/205815908-Using-code-injection (checked October 28, 2026, used for the AdSense steps)

Why ads.txt matters

ads.txt is a plain text file listing who may sell ads on your domain. Without your AdSense line in it, AdSense shows a warning and buyers may avoid your inventory. If you already have the file, add the line rather than replacing it.

Policy and consent

AdSense policies forbid clicking your own ads or asking others to, and restrict content such as copyrighted material and adult themes. Breaking them can close the account.

For visitors in the EEA and UK, Google requires a certified consent platform when serving ads; a basic banner may not be enough. See /guides/how-to-add-cookie-banner-to-website for the consent side.

How it works

  1. Sign up at AdSense and add your site.
  2. Copy the AdSense code and place it in the <head> of every page.
  3. Create or update ads.txt at the root of your domain with your publisher line.
  4. Request review and wait for approval.
  5. Turn on Auto ads or create ad units once approved.

Tips

  • Put the code on your most-visited pages first; Google notes that reviews stall when the code sits on pages with little traffic.
  • Open yourdomain.com/ads.txt in a browser after publishing to confirm the file loads as plain text.
  • Never test by clicking your own ads; use AdSense's preview tools instead.

Frequently asked questions

How long does AdSense approval take?

Google says usually a few days, sometimes 2 to 4 weeks. Keep the code live during the review.

Where does the AdSense code go?

Between the <head> and </head> tags on every page where you want ads.

Can I use AdSense on a free website builder subdomain?

AdSense needs a site where you can edit the HTML and serve ads.txt at the domain root, so a custom domain is the practical route.

Related: Verify in Google Search Console, How to add a cookie banner, Privacy policy generator, Core Web Vitals, Terms of service vs privacy policy.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap