How to Create and Verify ads.txt on WordPress

30 live guides

Tutorial / AdSense readiness

How to Create and Verify ads.txt on WordPress

This guide walks through adsense readiness with a practical sequence, a proof asset, and implementation notes so the recommendation can be checked before publishing.

IntentProblem solving
Proof AssetServer/root examples
MonetizationAdSense

What This Guide Solves

An ads.txt file is small, but it is easy to get wrong on WordPress. The common failure is not the line itself. The common failure is putting it in the wrong place, serving it as an HTML page, blocking it with robots.txt, breaking HTTP or HTTPS access, or letting a security rule return an error instead of the text file.

Google's AdSense guidance says ads.txt is not mandatory, but it is highly recommended because it helps identify authorized sellers and protect inventory from counterfeit selling. For AdSense, the file must include your publisher ID, be uploaded to the root directory, and be reachable as a plain text file at a URL such as https://example.com/ads.txt.

For Eiway, AdSense has now been applied for and the live /ads.txt path returns 200 OK with a non-placeholder publisher line. The right move during review is to keep the file stable, confirm AdSense sees the same account, and change it only if AdSense shows a specific ads.txt action.

The proof history still matters: on May 11, 2026, https://eiway.com/ads.txt did not return a plain-text file with 200 OK. After application, the live check on May 13, 2026 shows https://eiway.com/ads.txt returning 200 OK, with no placeholder publisher ID and no robots.txt block. That turns ads.txt from an open blocker into a monitoring item.

Official references used for this tutorial include Google's Ads.txt guide, Ensure your ads.txt files can be crawled, and About the AdSense ads crawler.

Disclosure: This is an informational ads.txt guide. Eiway may add affiliate links or product links later, but the recommendation here is based on official AdSense guidance, live root-file verification, and current review-stage constraints, not on commission.

Recommended Setup

Use the hosting root method first. Upload a plain text file named ads.txt to the root directory of the live domain, then verify it from the public web.

Use a WordPress plugin only if the plugin truly serves the root URL /ads.txt as plain text with HTTP 200 OK. Do not create a normal WordPress page called "ads.txt" and assume it is enough. AdSense needs the root text file path to be reachable and parseable.

For Eiway, this article now documents both the pre-application failure state and the post-application fix. The site should keep ads.txt active during review and should not rotate the publisher line unless AdSense requests a change.

The Correct AdSense Line

Your AdSense line should look like this, using your real publisher ID from your AdSense account:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Replace pub-0000000000000000 with your actual publisher ID. Do not guess the ID, do not copy another site's ID, and do not publish the placeholder line as your live ads.txt file.

If you use another ad network later, add that network's authorized seller line too. Keep one seller entry per line.

Step-by-Step Process

Step 1: Copy The Snippet From AdSense

In AdSense, open the site with the ads.txt alert or status, choose the Ads.txt snippet option when available, and copy the provided line. Google says the publisher ID must be included and correctly formatted for verification.

Step 2: Create A Plain Text File

Create a file named exactly:

ads.txt

Use a plain text editor. Do not use a rich text editor, page builder, document editor, or HTML block. The file should contain the seller line only, plus any other legitimate ad-network lines you actually need.

Step 3: Upload It To The Root Directory

Upload the file to the root directory for the live domain. For a site at example.com, the public URL should be:

https://example.com/ads.txt

On WordPress hosting, that usually means the same server level where wp-config.php lives, not the media library and not a post/page screen.

Step 4: Check HTTPS And HTTP

Google's ads.txt crawler checks both HTTP and HTTPS paths. The safest setup is:

  • https://example.com/ads.txt returns the file with HTTP 200 OK.
  • http://example.com/ads.txt redirects to the HTTPS file or also returns the file.
  • If the site uses www, the root domain redirects correctly to the www ads.txt path.

For Eiway, the current observed state after application is healthier: /ads.txt returns 200 OK and no longer exposes the old 404/406 failure. Keep the file plain, reachable, and unchanged unless AdSense shows a specific account-level action.

Step 5: Confirm robots.txt Does Not Block It

Google says the ads.txt file can be ignored if robots.txt disallows the file path or a relevant crawler. Check:

https://example.com/robots.txt

For Eiway, the current robots.txt allows normal crawling and does not block /ads.txt. The earlier blocker was the /ads.txt response itself, not robots.txt, and the live HTTPS path now returns 200 OK.

Step 6: Confirm The File Is Plain Text

Open the URL in a browser. You should see the seller line as plain text. You should not see:

  • a WordPress theme page
  • a 404 page
  • a 406 security page
  • a login page
  • a redirect loop
  • HTML layout around the line

Then check the response headers with:

curl -I https://example.com/ads.txt

The target result is HTTP 200 OK.

Step 7: Ask AdSense To Recheck

After the file is live, use the AdSense Sites area to check for updates. Google notes that ads.txt changes may take a few days to appear in AdSense, and for low-traffic sites it can take up to a month.

Eiway Implementation Notes

The Eiway automation created a template file at automation/ads-txt/ads.txt.template and a verification record at automation/ads-txt/verification-2026-05-11.md.

The template intentionally uses a placeholder publisher ID for documentation only. The live file must keep the real account publisher line and should never use the placeholder line.

The public verification now has two useful states:

  • Historical state on May 11, 2026: browser-style /ads.txt returned 404 Not Found, and text/plain checks could trigger 406 Not Acceptable.
  • Current state on May 13, 2026: https://eiway.com/ads.txt returns 200 OK, contains no placeholder publisher ID, and robots.txt does not disallow /ads.txt.

The next fix is not to keep changing the file. The next fix is monitoring: confirm AdSense recognizes the publisher line, keep HTTP/HTTPS access stable, and only edit ads.txt if AdSense shows a specific issue.

Verification Commands

Use these commands from a local terminal:

curl -I https://example.com/ads.txt

curl -L https://example.com/ads.txt

curl -I http://example.com/ads.txt

curl -L https://example.com/robots.txt

For a completed setup, the header check should return 200 OK, and the body check should show the exact seller line.

Common Mistakes

  • Uploading ads.txt to /wp-content/uploads/ instead of the root domain.
  • Creating a WordPress page instead of a root text file.
  • Publishing the placeholder publisher ID.
  • Serving the file with a 404, 406, 500, or soft-404 response.
  • Letting robots.txt block /ads.txt.
  • Making HTTPS work but leaving HTTP broken.
  • Copying from a rich text editor and adding invisible formatting characters.
  • Removing a correctly configured ads.txt file too soon because AdSense has not refreshed yet.

Monetization Notes

This article is part of the AdSense readiness path, but ads.txt does not create revenue by itself. It protects authorized selling and reduces counterfeit-inventory risk once ads are running.

Do not add affiliate links to this guide unless a tool is genuinely required for the reader's hosting setup. The highest-value action is a correct root file and a clean verification record.

Review Monitoring Gate

During AdSense review, confirm:

  • the live AdSense publisher line remains in /ads.txt
  • https://eiway.com/ads.txt returns 200 OK
  • http://eiway.com/ads.txt redirects correctly or returns the file
  • the file body does not contain the placeholder publisher ID
  • robots.txt does not block /ads.txt
  • AdSense status is monitored without unnecessary file changes

Keep the template staged for documentation only. Do not replace the live ads.txt file with a placeholder line.

Sources Used

FAQ

Is ads.txt mandatory for AdSense?

Google says ads.txt is not mandatory, but it is highly recommended. For a serious publisher site, treat it as part of the launch checklist.

Can I create ads.txt as a WordPress page?

No. Use a root text file or a plugin that truly serves /ads.txt as plain text from the root URL. A normal themed WordPress page is not the same thing.

What status code should ads.txt return?

The target is HTTP 200 OK for the file URL. Google says a file body with a not-found status can be ignored.

Why did Eiway previously show 404 or 406?

Before application, different request headers produced different failures: a browser-style request reached a WordPress missing-page response, while a text/plain curl request could trigger a 406 response. That has now been corrected for the live HTTPS path.

What is the next Eiway step?

Hold the file steady during AdSense review. If AdSense reports an ads.txt issue, capture the exact message, verify the publisher line, and request a recheck after the fix.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top