Fix the “ads.txt Not Found” Error in Under 9 Minutes
CodePress Academy — A quick, practical guide to create and upload an ads.txt file so your ad platforms stop showing the warning and ad demand returns to normal.
What is ads.txt and why it matters
ads.txt stands for Authorized Digital Sellers. It is a plain text file you place at the root of your domain to declare which advertising partners are allowed to sell your inventory. Major ad exchanges (including Google AdSense) check this file — if it’s missing or incorrect, you’ll often see a dashboard warning like “ads.txt not found” and demand may fall because buyers cannot verify authorized sellers.
Fixing this is usually simple: create a correctly formatted ads.txt and upload it to https://yourdomain.com/ads.txt. Follow the steps below — you can complete them in under 9 minutes.
What you need before starting
- Your AdSense publisher ID (format:
pub-1234567890123456) or seller IDs from other ad partners. - Access to your website files: cPanel File Manager, FTP/SFTP, your host’s file manager, or the WordPress dashboard (plugins or theme files).
- A plain-text editor (Notepad, TextEdit) — no rich text.
Step-by-step: Fix ads.txt in under 9 minutes
1) Collect your seller IDs (1–2 minutes)
Log in to AdSense and other ad networks you use. Locate the publisher/seller IDs each partner gives you. AdSense provides a line you can copy. If you use multiple networks, gather all lines (one line per partner).
2) Create the ads.txt file (1 minute)
Open a plain-text editor and create a file named ads.txt. Each authorized seller must be on its own line using this format:
domain, seller_id, relationship, cert_authority_id
Example for Google AdSense:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
Example for another partner (reseller example):
example-exchange.com, 987654, RESELLER, abcdef0123456789
If a partner did not provide the cert_authority_id, you can omit it. Use the exact lines provided by your ad partners when possible.
3) Upload ads.txt to your site root (2–4 minutes)
Choose the fastest method available to you:
- cPanel / File Manager: Login → File Manager → public_html (or document root) → Upload
ads.txt. - FTP / SFTP: Connect to the server and upload
ads.txtto/public_html,/www, or the domain root. - WordPress plugin: Install a plugin like “Ads.txt Manager” or “Ads.txt for WP” and paste your content. Some plugins create the file at root automatically.
- Static host (GitHub Pages/Netlify/Vercel): Add
ads.txtto the repository root and redeploy.
4) Verify the file (under 1 minute)
Open your browser and visit https://yourdomain.com/ads.txt. You should see your plain text lines. The URL must return HTTP 200 (not a 404 or redirect). If it redirects (for example, from non-www to www), ensure the file is present at the final served domain.
5) Clear caches and re-check (30 seconds)
If you use caching plugins, a CDN, or Cloudflare, purge the cache so the new file becomes visible right away . Then reload the /ads.txt URL to confirm.
Common problems and how to fix them
- File not found after upload: Confirm the file is in the domain root (not in a theme folder or a subdirectory). The correct path is
https://yourdomain.com/ads.txt. - Wrong MIME type or HTML wrapper: The file must be served as plain text. If a WordPress plugin is rendering the content inside an HTML page, use FTP or File Manager to place a real text file at root.
- Permissions issue: Set file permissions to 644. If you can’t read the file after upload, contact host support.
- Subdomains and www vs non-www: Ads.txt must reside on the exact host that serves ads. Place it on both
example.comandwww.example.comif needed, or ensure proper redirects. - Plugin saved content but file not created: Some plugins only store the text in the database and do not write a root file. Use FTP or host file manager in that case.
Sample ads.txt (replace with your IDs)
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
```
other-ad-network.com, 987654, RESELLER, abcdef0123456789 Only include lines provided by your ad partners. If you only use AdSense, the single Google line is usually sufficient.
How long until the warning disappears?
After the file is live, ad platforms typically detect it quickly, but dashboards may take a few hours to update. Ads delivery usually resumes promptly once the file is verified. If the warning persists after 24 hours, re-check the file path, formatting, and whether the ad network requires additional configuration.
Advanced tip: serve ads.txt from WordPress (optional)
If you prefer to manage ads.txt from within WordPress without plugins that fail to write to root, add a small snippet to your theme’s functions.php to serve the file dynamically. Because editing theme files can be risky, make a backup first and prefer using a child theme.
// Example (advanced) approach - only for users comfortable editing theme files
```
add_action('init', function() {
if ($_SERVER['REQUEST_URI'] === '/ads.txt') {
header('Content-Type: text/plain; charset=utf-8');
echo "google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0\n";
exit;
}
});
```
This method serves /ads.txt without creating a physical file, but be careful: theme updates may remove your changes.

Hi Please Do not Spam in Comments