Skip to content
Pakistan Era logo
Guides

Fix the AdSense ads.txt Warning on Your Pakistani Website: Earnings at Risk

AdSense shows Earnings at Risk when ads.txt is missing or wrong. See the exact line, where to upload it and how long Google takes to recheck your site.

Shahid Anwar, author at Pakistan EraShahid AnwarUpdated 6 min read
A server room with rows of racks and blue lights

Short answer: Create a plain text file called ads.txt, paste into it the single line AdSense gives you, and upload it to the root of your site so that yoursite.com/ads.txt opens in a browser. The line looks like google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0, with your own publisher ID. Then click "Check for updates" in AdSense.

A blogger in Multan opens AdSense one morning and sees an alert that his earnings are at risk because of ads.txt. Nothing is broken on his site. Ads still show. But Google is telling him that its systems cannot find a file proving he allows AdSense to sell his space.

We read Google's AdSense Help pages on ads.txt again on 8 November 2026. The steps below follow them. The last step, opening the address in a browser, confirms the file is live on your site.

Ads.txt is a short public file that lists who may sell your ad space

Ads.txt stands for Authorized Digital Sellers. It is a text file on your site that names the companies allowed to sell your ad space. Google says it helps make sure your ad inventory is sold only through sellers you have named, such as AdSense.

Google also says using ads.txt is not mandatory, but is highly recommended. In practice, AdSense shows a warning when the file is missing or does not name your account, and your earnings can be flagged as at risk until you fix it.

The file is public. Anyone can open it, so never put passwords or private details in it. It only holds ad seller lines.

The AdSense warning names one of two problems

Google lists two statuses. "Not found" means your site has no ads.txt file at all. "Unauthorized" means a file exists but your own publisher ID is missing from it. Each has a different fix, so read the status first.

Status in AdSenseWhat it meansWhat to do
Not foundNo ads.txt file at the site rootCreate the file and upload it
UnauthorizedFile exists, publisher ID missingAdd the AdSense line to the file
Earnings at riskOne of the above is blocking full earningsFix the file, then recheck
AdSense ads.txt statuses and fixes for a Pakistani publisher

Create and upload the file in six steps

You need your AdSense publisher ID, a text editor and access to the folder where your site lives. A WordPress site on shared hosting is the common case in Pakistan. Most hosting panels have a File Manager where you can upload the file.

  1. Sign in to AdSense and copy the ads.txt snippet from the alert or the Sites section.
  2. Open Notepad and paste the line exactly as given. Nothing else is needed.
  3. Save the file with the name ads.txt, all lowercase, as plain text.
  4. Upload it to your site's root folder, the one that holds your homepage files.
  5. Open yoursite.com/ads.txt in a browser. The line must appear on the screen.
  6. In AdSense, go to Sites and click "Check for updates".
Six steps to create and upload an ads.txt file for AdSense on a Pakistani website

Google explains the logic of step five: if the file shows in your browser, AdSense will likely find it too. If your browser shows a 404 error or a login page, AdSense cannot see it either.

The line has four parts and the ID must be your own

Each ads.txt line has four fields separated by commas. The first is Google's domain, the second is your publisher ID starting with "pub-", the third says DIRECT, meaning you own the account, and the fourth is a fixed Google certification code. Only the second changes from site to site.

FieldExampleWho sets it
Seller domaingoogle.comFixed
Publisher IDpub-0000000000000000Your AdSense account
RelationshipDIRECTFixed
Certification IDf08c47fec0942fa0Fixed
The four fields in an AdSense ads.txt line explained

Copy the line from your own AdSense account rather than from a website or video. A wrong ID, or an ID copied from someone else, is the likeliest reason for "Unauthorized". If you already use another ad network, keep its lines and add the Google line below them. Do not delete a working network's line.

Wait for the recheck, and fix the usual faults if it does not clear

Google says changes may take a few days to show in AdSense, and up to a month if your site makes few ad requests. The "Check for updates" button asks for a manual recheck so you do not have to wait for the crawl.

  • The file sits in a sub-folder, not the root. It must be at the main address.
  • The file name is "ads.txt.txt" because Windows hid the extension. Rename it.
  • The file is in a word processor format, not plain text.
  • The site redirects to another address, so the file is looked for on the wrong domain.
  • The publisher ID has a typo or a missing character.

Google's crawler checks that most guides skip

If the file shows in your browser but AdSense still flags it, Google's page on making ads.txt crawlable lists the faults to rule out. These are the ones that catch Pakistani WordPress sites most often.

CheckWhat Google says
www or no wwwCrawling starts at the root domain. A file at www.yoursite.com/ads.txt is only read if yoursite.com/ads.txt redirects to it
robots.txtA line such as Disallow: /ads also blocks /ads.txt. Add Allow: /ads.txt above it
Status codeThe file must answer with HTTP 200. A 404 means Google treats it as missing, even if text shows
Server errorsOn a soft 404 or a 500 error, Google keeps the old entries for up to 5 days. A real 404 removes them
http and httpsMake the file reachable on both
RedirectsOne redirect to another domain is supported. Several redirects are fine if they stay inside your own domain

To see the status code yourself, open Command Prompt on Windows and type curl -I https://yoursite.com/ads.txt. The first line should say 200. On WordPress, Google suggests a plugin, and many ad plugins already include an ads.txt feature.

Do not delete a correct file while you wait. Google says any change to the file restarts the review. If your server is struggling and returns errors, our guide to handling Googlebot with a 503 or 429 code explains how to keep errors short. Moving to a new domain? The file must exist on the new domain too, as covered in moving a website to a new domain without losing rankings.

If your account is not approved yet, ads.txt is not your first task. Read the AdSense eligibility check for Pakistani websites first. Once earnings arrive, how AdSense pays in Pakistan explains the payment steps.

A slow site also costs you ad revenue. Ad slots without reserved space make a page jump as ads load, which we cover in the Core Web Vitals check.

Common questions

Is ads.txt required for AdSense?

Google says it is not mandatory but is highly recommended. AdSense still shows an "Earnings at risk" alert when the file is missing or wrong, so treat it as required.

Where do I put the ads.txt file?

Put it in the root directory of your site, so it opens at yoursite.com/ads.txt. A file in a sub-folder will not be found.

How long does AdSense take to see my file?

Google says a few days, and up to a month for sites with few ad requests. Click "Check for updates" in the Sites section to ask for a manual recheck.

What does DIRECT mean in the line?

DIRECT says you own and manage the AdSense account yourself. It is a fixed part of the line Google gives you.

Can I keep other ad networks in the file?

Yes. ads.txt can hold many lines. Add the Google line and keep the lines of networks you still use.

How do I test that the file works?

Type your ads.txt address into a browser. Google says that if the file displays there, AdSense will likely find it. For a firmer test, check that the address returns HTTP 200 and that robots.txt does not block it.

How we verified this

What we checked and where we read it.

Last checked 8 November 2026. We read Google's AdSense Help pages: the ads.txt guide for the line format, the root directory rule and the recheck timing, resolve common ads.txt issues for the missing file and missing ID cases, ensure your ads.txt files can be crawled for the www, robots.txt, HTTP 200, 5 day and http and https rules, and the ads.txt FAQs for WordPress, subdomains and redirects. AdSense wording can change, so match what your own account shows.

About the author

Shahid Anwar, author at Pakistan Era

Senior Writer, Public Services and Technology

Shahid Anwar

Shahid joined us in 2024 as an author. He is a senior contributor to Pakistan's leading technology websites. He writes detailed articles, mostly covering his expertise in the latest tech, mobiles, apps, gadgets, and step-by-step guides. His ideology is to help people understand the latest trends and explain complex methods through very easy-to-understand guides.

TopicsAdSenseads.txtWebsite MonetisationPublishersPakistan