A correct AdSense ads.txt WordPress setup publicly identifies Google and any other approved advertising platforms that are authorized to sell your website inventory. The file lives at the root-domain URL, such as https://example.com/ads.txt, and normally contains one plain-text record for each authorized seller. Google says ads.txt is not mandatory for AdSense, but it is highly recommended because it helps buyers identify authorized inventory and makes counterfeit inventory harder to sell.
This guide shows two safe WordPress methods: creating the file with a plugin and uploading a physical file through your hosting account. It also explains how to preserve existing seller records, copy the exact line from AdSense, verify HTTP access, understand AdSense status messages, and resolve crawler problems. For the preceding technical step, review how to connect a WordPress website to AdSense. For privacy and consent configuration, continue to the AdSense cookie consent and CMP guide.
Quick Answer: AdSense ads.txt WordPress Setup
To complete an AdSense ads.txt WordPress setup, sign in to AdSense, open Sites, select the site showing Not found or Unauthorized, choose the ads.txt option, and copy the seller line provided by Google. Add that exact line to a plain-text file named ads.txt at the root of the domain, or use one WordPress plugin that creates the root URL virtually. Then open https://yourdomain.com/ads.txt in a private browser window, confirm that the content appears as plain text with a successful response, and click Check for updates in AdSense. Changes may take a few days to appear; low-traffic sites may take up to a month.
What Is ads.txt and Why Does It Matter?
ads.txt stands for Authorized Digital Sellers. It is an IAB Tech Lab standard that allows a publisher to publish a public list of exchanges, supply-side platforms, and seller accounts permitted to sell the site advertising inventory. Programmatic buyers can crawl this list and compare it with the seller information in an ad request.
The file does not block bots, prevent invalid clicks, replace AdSense code, or serve advertisements by itself. Its purpose is supply-chain authorization. A correct file can help prevent unauthorized accounts from presenting counterfeit inventory as if it came from your domain.
Is ads.txt Required for AdSense Approval?
Google states that using ads.txt is not mandatory, although it is highly recommended. Therefore, a missing file should not be described as a universal legal or approval requirement. However, when a file exists, Google uses it to determine which publisher identifiers are authorized for that domain. An incorrect file can reject ad requests associated with an identifier that is not listed correctly.
AdSense can also offer ads.txt as one of the available ownership-verification methods when adding a site. Site ownership verification, site policy review, ads.txt authorization, and ad serving are related but separate states. A site may show an ads.txt status such as Authorized while still requiring site review.
The Correct Google AdSense ads.txt Record
The safest method is to copy the line directly from your own AdSense account rather than typing it from memory. A typical Google record looks like this:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0Replace pub-0000000000000000 with the publisher ID shown in your account. Do not copy another publisher ID, remove digits, add quotation marks, or change the certification authority ID supplied by Google.
Field 1: Advertising system domain
google.com identifies the advertising system or exchange through which buyers connect. For another ad network, use only the domain that the network officially provides.
Field 2: Publisher or seller account ID
The second field is the seller account identifier. For AdSense, it uses the pub- format. This value must match the publisher ID associated with the website authorized AdSense account.
Field 3: DIRECT or RESELLER
DIRECT indicates that the publisher directly controls the listed account with the advertising system. RESELLER indicates that another party controls the listed account and resells the inventory. Do not change Google supplied relationship value or invent records for a partner.
Field 4: Certification authority ID
The fourth field is optional in the general ads.txt specification but is included in Google standard AdSense record. For Google, the commonly supplied value is f08c47fec0942fa0. Use the exact line shown in your account.
Before You Change the WordPress ads.txt File
- Confirm the exact root domain added to AdSense, including whether the canonical site uses www or non-www.
- Open the current
/ads.txtURL to see whether a file already exists. - Copy all existing records into a backup before making changes.
- Identify which plugin, hosting feature, ad-management tool, or physical file currently controls the URL.
- Copy the Google line from the correct AdSense account.
- Avoid using multiple plugins or methods to generate the same URL.
- Keep records from other authorized ad partners unless those partnerships have ended.
Overwriting an existing file with only the Google line can remove valid sellers from another network or monetization provider. Instead, add the new record on a separate line and preserve every seller that is still authorized.
Method 1: Set Up ads.txt with a WordPress Plugin
Google WordPress ads.txt FAQ suggests considering a plugin when the CMS does not provide direct root-file access. Some ad-management plugins already include ads.txt support, so check the tools you use before installing another plugin.
- Back up the current website and copy any existing ads.txt content.
- In WordPress, open Plugins, then Add New.
- Choose a maintained plugin that explicitly creates or edits the root-domain ads.txt endpoint.
- Install and activate only one plugin responsible for this file.
- Open the plugin ads.txt settings.
- Paste the exact line copied from AdSense on its own line.
- Preserve existing authorized seller records.
- Save the changes and clear page, object, server, and CDN caches.
- Open
https://yourdomain.com/ads.txtin a private browser window. - Confirm that the result is plain text and includes the correct publisher ID.
The WordPress Media Library cannot be used like a normal root directory for this purpose. Uploading ads.txt as a media attachment usually places it under /wp-content/uploads/, which is not the required root-domain URL.
Plugin advantages
- No hosting file manager or SFTP access is required.
- The file can be edited from the WordPress dashboard.
- A plugin may validate basic formatting or merge network records.
- It is convenient for managed WordPress platforms that restrict root files.
Plugin risks
- Two plugins can conflict or generate different versions.
- Disabling the plugin can remove the virtual ads.txt endpoint.
- Caching or security rules can prevent the output from reaching crawlers.
- An abandoned plugin can create compatibility or security problems.
- A plugin may overwrite records managed by another monetization service.
Method 2: Upload a Physical ads.txt File to the Root Directory
A physical root file is often the simplest option when you control the hosting account. You can create it through a hosting file manager, SFTP, SSH, or a deployment repository. The correct directory is the document root that serves the public website, commonly named public_html, www, htdocs, or the domain-specific web root.
- Open a plain-text editor, not Microsoft Word or a rich-text editor.
- Paste the exact seller line copied from AdSense.
- Add any other authorized sellers on separate lines.
- Save the filename exactly as
ads.txtusing plain UTF-8 text. - Open the hosting file manager or connect through SFTP.
- Navigate to the document root for the correct domain.
- Back up or download the existing ads.txt file when one is present.
- Upload the new file or edit the existing file without removing valid records.
- Set normal readable file permissions appropriate for the hosting environment.
- Visit
https://yourdomain.com/ads.txtand verify the live response.
Do not place the file inside the active theme, child theme, plugin directory, or uploads folder. A theme update can remove a theme-level file, and those directories do not normally map to the required root URL.
Method 3: Use the Hosting or Monetization Platform ads.txt Feature
Some managed hosts, ad-management platforms, and publisher tools generate ads.txt for you. In that case, use the platform official editor and do not create a competing WordPress endpoint. The public URL must still resolve at the root domain.
Before editing a platform-managed file, determine whether the provider automatically adds network records. Manual changes can be overwritten during synchronization. Keep a copy of the provider instructions and verify the live result after every update.
How to Add Google to an Existing ads.txt File
An existing file may contain records from Google, an ad-management company, header-bidding partners, or another network. Add the new Google record as a separate line. Do not paste it into the middle of another record and do not remove authorized partners without confirming that the relationship has ended.
# Authorized sellers for example.com
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
example-exchange.com, 12345, RESELLER, abcdef1234567890Lines beginning with # are comments in the ads.txt format and can be used for human-readable notes. Comments are optional. Keep the seller records themselves clean, one record per line.
How to Find Your AdSense Publisher ID
The most reliable method is to copy the ads.txt snippet from the site details in AdSense. When the site shows Not found or Unauthorized, open the site and choose the ads.txt option, then use the provided copy control. You can also find the publisher ID in the account information, but copying the complete snippet reduces formatting errors.
A publisher ID typically looks like pub-1234567890123456. Do not confuse it with a customer ID, ad-slot ID, channel ID, Google Analytics measurement ID, Google Ads conversion ID, or Site Kit property ID.
Verify the Public ads.txt URL
After an AdSense ads.txt WordPress change, the public URL is the most important test. Enter the root address directly in a private browser window:
https://yourdomain.com/ads.txt- The URL should load without authentication.
- The response should show plain-text seller records rather than a designed webpage.
- The Google line should contain the exact publisher ID.
- The file should not be HTML, PDF, DOCX, or another document format.
- The URL should not redirect through a login, cookie wall, or security challenge that blocks crawlers.
- The final response should be successful, normally HTTP 200 OK.
- Both HTTP and HTTPS requests should reach the correct file directly or through a valid redirect.
Seeing the file in your browser is a strong sign that the implementation is reachable, but AdSense still needs to crawl and process it before the account status changes.
Understand AdSense ads.txt Status Messages
| Status | Meaning | What to do |
|---|---|---|
| Not applicable | The publisher ID is not required because a platform manages the file | No action is required unless the platform instructs otherwise |
| Not found | AdSense did not find an ads.txt file during its last crawl | Create the root file, verify access, and check for updates |
| Unauthorized | A file exists, but the required publisher ID was not found | Add the exact AdSense seller line and confirm formatting |
| Authorized | The publisher ID was found in the file | No ads.txt action is required |
Authorized does not automatically mean the site has passed AdSense review or that ads are configured. Check the separate site status, which may still show that review is required or in progress.
Ask AdSense to Check for Updates
- Sign in to AdSense.
- Open Sites.
- Select the website.
- Confirm that the correct ads.txt line is publicly available.
- Click Check for updates when the option is shown.
- Allow time for the crawler and account interface to refresh.
Google says changes may take a few days to appear. When a site makes few ad requests, the update can take up to a month. Do not repeatedly delete and recreate a correct file, because each change can affect the review timeline.
Crawler Requirements for an ads.txt File
Google must be able to fetch and parse the file. A browser-visible page can still fail when it returns the wrong status code, contains invalid characters, or is blocked by robots.txt, a firewall, a CDN rule, or a security challenge.
Use the root domain
Ads.txt crawling begins at the root domain. If the canonical website uses www, the non-www root request should return or redirect to the correct www ads.txt URL. A file available only inside a WordPress subdirectory is not a substitute for the root-domain endpoint.
Return HTTP 200 OK
A successful body with an HTTP 404 response is still treated as missing. This can happen with a soft-404 template that displays text while the server reports that the resource does not exist. Check the response headers through hosting tools, browser developer tools, or a command-line request.
curl -I https://yourdomain.com/ads.txtAllow crawling in robots.txt
Do not disallow the ads.txt path or the crawler that needs it. A broad rule such as Disallow: /ads can also match /ads.txt. Review robots.txt carefully before adding an exception.
User-agent: *
Allow: /ads.txtSupport HTTP and HTTPS
Google attempts to crawl ads.txt over both HTTP and HTTPS. Configure redirects so both protocols reach the correct file. Also make sure the www and non-www versions do not expose contradictory content.
Use valid plain text
Use a plain-text editor and avoid invisible rich-text formatting, smart punctuation, HTML tags, extra commas, or copied code fences. Each seller record should be on its own line and follow the ads.txt specification.
Common AdSense ads.txt WordPress Problems and Fixes
Problem: The URL shows a 404 error
Confirm that the file is in the correct document root or that the WordPress plugin is active. Flush WordPress permalinks only when a virtual endpoint depends on rewrite rules, then clear all cache layers. Check whether a security plugin or host blocks text files at the root.
Problem: The file exists but AdSense says Not found
- Wait a few days after the first upload.
- Confirm that the response status is 200 rather than a soft 404.
- Check HTTP, HTTPS, www, and non-www behavior.
- Review robots.txt and firewall rules.
- Remove login, maintenance, geoblocking, or bot challenges from the endpoint.
- Check for invalid characters or malformed records.
- Use Check for updates after confirming the live file.
Problem: AdSense says Unauthorized
The crawler found a file, but the required publisher ID was not recognized. Copy the exact snippet from AdSense and compare every digit. Confirm that the record appears on one line and that WordPress is not serving an older cached file.
Problem: The wrong publisher ID appears
Replace the unauthorized ID only when it does not belong to an active, legitimate seller relationship. If an ad-management partner uses a reseller record, obtain the correct line from that partner rather than guessing whether it should be removed.
Problem: A plugin and a root file conflict
Choose one source of truth. Disable the unnecessary plugin or remove the duplicate physical file only after backing up all records. Then verify which version appears publicly and clear every cache.
Problem: The browser downloads the file
A download is not always a crawler failure, but the server should deliver plain text with a suitable content type and a successful response. Check hosting MIME settings and make sure the file is not being transformed into a media attachment.
Problem: A CDN serves an old version
Purge the exact /ads.txt URL from the CDN and server cache. Then open the endpoint in a private browser window and verify the publisher ID before requesting another AdSense check.
Problem: Security challenges block Google
Bot protection, country blocks, browser challenges, password protection, and maintenance modes can prevent crawling. Allow legitimate access to the ads.txt endpoint while keeping the rest of the security policy proportionate.
Subdomains, WordPress Multisite, and Multiple Domains
Subdomains
Google can crawl and enforce ads.txt files on subdomains when the root-domain file references the subdomain using the applicable ads.txt declaration. Do not assume that a root file automatically authorizes every independently monetized subdomain. Follow the instructions from each advertising platform and the current IAB specification.
WordPress multisite
In a subdirectory multisite network, one root-domain file may cover the shared domain, but the authorized seller relationships still need to match the inventory. In a domain-mapped or subdomain network, each public root domain may require its own endpoint. Plan the file structure with the hosting and monetization setup rather than installing a separate conflicting plugin on every site.
Multiple websites in one AdSense account
Each root domain should expose the correct file for the seller accounts authorized on that domain. The same AdSense publisher ID may appear on multiple owned sites when that account is authorized, but verify each site separately in the AdSense Sites interface.
DIRECT Versus RESELLER Records
| Relationship | Who controls the seller account? | Typical use |
|---|---|---|
| DIRECT | The publisher directly controls the account with the listed exchange or SSP | The publisher own AdSense account |
| RESELLER | An intermediary controls the listed account and resells the inventory | A monetization partner or managed-ad provider |
Do not convert every line to DIRECT because it looks stronger. The relationship must describe the real seller-account relationship. Use records supplied by the platform or partner and remove obsolete sellers when the commercial relationship ends.
Security and Maintenance Best Practices
- Keep a dated backup of every ads.txt version.
- Review seller records when adding or removing an ad partner.
- Restrict WordPress and hosting access to trusted administrators.
- Use one controlled method to generate the public file.
- Monitor the root URL after plugin, theme, CDN, and hosting changes.
- Check AdSense Sites periodically for Not found or Unauthorized status.
- Do not publish seller records sent through unverified email or chat messages.
- Remove former partners only after confirming they no longer sell inventory.
- Keep comments and documentation separate from active seller lines.
An ads.txt file is intentionally public. It should contain seller authorization data, not passwords, API keys, tax details, payment information, private email addresses, or WordPress credentials.
Final AdSense ads.txt WordPress Checklist
Use this final review before relying on the file for authorization or site verification.
- I copied the seller line from the correct AdSense account.
- The publisher ID matches every digit shown in AdSense.
- The filename is exactly ads.txt.
- The file appears at the root-domain /ads.txt URL.
- I used one plugin or one physical-file method, not conflicting methods.
- Existing authorized seller records were preserved.
- The Google record appears on one plain-text line.
- The public URL works without login or browser challenge.
- The response is successful and not a soft 404.
- HTTP and HTTPS reach the same correct file.
- The canonical www or non-www version is handled correctly.
- Robots.txt does not block the ads.txt path.
- WordPress, server, and CDN caches were cleared.
- I opened the URL in a private browser window.
- I used Check for updates in AdSense after verifying the live file.
Frequently Asked Questions
Is ads.txt mandatory for Google AdSense?
No. Google says ads.txt is not mandatory but is highly recommended. It helps buyers verify authorized sellers and can reduce counterfeit-inventory risk.
Where should ads.txt go in WordPress?
It must be reachable from the root-domain URL, such as https://example.com/ads.txt. A physical file normally goes in the website document root; a WordPress plugin may create the same URL virtually.
Can I upload ads.txt through the WordPress Media Library?
Normally, no. Media uploads are stored under an uploads directory and do not create the required root URL. Use a suitable plugin, hosting file manager, SFTP, or the hosting platform ads.txt feature.
What is the correct AdSense ads.txt line?
Copy the exact line from your AdSense account. It normally follows this form: google.com, pub-YOUR_ID, DIRECT, f08c47fec0942fa0. Replace the placeholder with the ID supplied by Google.
How long does AdSense take to detect ads.txt?
Google says changes can take a few days to appear. Sites with few ad requests may take up to a month. Verify that the live file is correct before waiting or requesting another check.
What does Unauthorized mean?
AdSense found an ads.txt file, but the required publisher ID was not found or recognized. Add the exact line from AdSense, correct formatting, clear caches, and ask AdSense to check again.
Can I have more than one line in ads.txt?
Yes. Use one line for each authorized seller account. Preserve records for active partners and remove sellers that are no longer authorized.
Should I use DIRECT or RESELLER?
Use the value supplied by the advertising platform. Your own AdSense account normally uses DIRECT; a partner-controlled seller account may use RESELLER.
Does ads.txt fix invalid traffic?
No. Ads.txt authorizes sellers; it does not filter bots, prevent click bombing, or validate user traffic. Use the AdSense invalid traffic guide for traffic-quality protection.
Does Authorized mean my site is approved?
No. Authorized means the publisher ID was found in ads.txt. Site review and the site Ready status are separate. A site can have an Authorized ads.txt status while still requiring AdSense review.
Can a plugin-generated ads.txt file work?
Yes, provided it is publicly reachable at the root URL, contains valid records, returns successfully, and remains available to Google crawler. Avoid multiple plugins controlling the same endpoint.
Should I add random seller lines to increase revenue?
No. Add only sellers authorized to sell your inventory. Random or copied records reduce transparency and may authorize accounts that have no legitimate relationship with the site.
Conclusion
A reliable AdSense ads.txt WordPress setup has four essential parts: the exact publisher line, one controlled implementation method, a crawlable root-domain URL, and successful verification in AdSense. Copy the snippet from your own account, preserve valid partner records, avoid conflicting plugins, and test the live endpoint after every cache, CDN, hosting, or monetization change.
Remember that ads.txt authorization does not replace AdSense code, policy compliance, site review, privacy disclosure, or traffic monitoring. Continue with the WordPress AdSense connection guide for code setup and the cookie consent and CMP guide for privacy configuration.
Related AdSense Guides
- Google AdSense Guides – Navigate approval, policy, account, earnings, placement, and payment topics.
- AdSense Policy, Account, and Payments Guide – Follow the main account and compliance roadmap.
- AdSense Account Setup – Browse account-configuration and compliance resources.
- Connect a WordPress Website to AdSense – Install and verify the main AdSense code.
- AdSense Cookie Consent and CMP Guide – Configure privacy disclosures and consent tools.
- AdSense Invalid Traffic Guide – Protect traffic quality and publisher-account safety.
- Google AdSense Policies for Publishers – Review policy, placement, privacy, and traffic rules.
- AdSense Site Review Checklist – Audit content, account setup, policy, and technical access.
Official Sources
- Google AdSense Help: Ads.txt guide
- Google AdSense Help: Resolve common ads.txt issues
- Google AdSense Help: Ads.txt FAQs, including WordPress
- Google AdSense Help: Ensure ads.txt files can be crawled
- Google AdSense Help: Ads.txt status meanings
- Google AdSense Help: Site management and ownership verification
- IAB Tech Lab: About ads.txt
- IAB Tech Lab: How to create and publish ads.txt
Important: This article is an educational setup guide. WordPress plugins, hosting interfaces, AdSense screens, and ads.txt specifications can change. Use the exact seller records provided by your advertising partners and verify the current Google and IAB documentation before changing a production file.

