TL;DR: An ads.txt file tells ad networks which sellers are authorized to monetize your site. Without it, Google AdSense shows an “Earnings at risk” warning and your revenue can drop. The easiest way to add it in WordPress is using the free Ads.txt Manager plugin (1M+ active installs) — install, paste your AdSense publisher line, save. If you prefer no plugins, upload the file to your root directory via cPanel or FTP. This guide covers both methods step-by-step.
What Is Ads.txt and Why Does Your WordPress Site Need It?
Ads.txt stands for Authorized Digital Sellers. It’s a simple text file that sits at the root of your domain (e.g., yoursite.com/ads.txt) and publicly declares which companies are authorized to sell ad inventory on your website.
The IAB Tech Lab created this standard in 2017 to combat a massive problem: ad fraud. Unauthorized sellers were impersonating legitimate publishers and selling fake ad inventory. Advertisers were paying for ads that either never displayed or appeared on the wrong sites entirely.
Here’s why you should care:
- Google requires it. If you use AdSense, Google will show an “Earnings at risk” warning until you add an ads.txt file. Your ad revenue will drop without it
- Ad fraud costs are massive. Global ad fraud losses reached $84 billion in 2023 and are projected to hit $172 billion by 2028, according to Juniper Research
- All major ad networks require it. AdSense, Ezoic, Mediavine, AdThrive, and every reputable ad network now expects an ads.txt file from publishers
- It protects your brand. Without ads.txt, unauthorized sellers could claim to represent your site and sell low-quality ads under your domain name
I’ve been using ads.txt on all my WordPress sites since the IAB first introduced it. If you’re running ads on your site — especially through Google AdSense — adding this file should be one of the very first things you do.
How the Ads.txt File Format Works
Before you add the file, it helps to understand what you’re actually pasting into it. Each line in an ads.txt file represents one authorized seller and follows this format:
<domain>, <publisher-ID>, <relationship>, <certification-authority-ID>
Here’s what each field means:
| Field | What It Is | Example |
|---|---|---|
| Domain | The ad system’s domain | google.com |
| Publisher ID | Your unique account ID on that platform | pub-1234567890123456 |
| Relationship | DIRECT (you have a direct account) or RESELLER (a third party sells on your behalf) | DIRECT |
| Certification Authority ID | Optional TAG-ID for the ad system (Google’s is f08c47fec0942fa0) | f08c47fec0942fa0 |
So a typical Google AdSense entry looks like this:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
Replace pub-1234567890123456 with your actual AdSense publisher ID. You can find this in your AdSense dashboard under Account → Account information.
Important: Each authorized seller gets its own line. If you use multiple ad networks (AdSense + Ezoic, for example), you’ll have multiple lines. All text must be lowercase except for DIRECT and RESELLER.
How to Get Your Ads.txt File from Google AdSense
If you use Google AdSense, Google provides your ads.txt entry directly. Here’s how to get it:

- Log in to your Google AdSense account
- If you see the “Earnings at risk” banner at the top, click “Fix now”
- Click the “Download” button to save your ads.txt file
- Open the downloaded file — it contains your unique publisher line

Once you have the file (or at least your publisher ID), you’re ready to add it to WordPress using one of the methods below.
Method 1: Add Ads.txt Using a Plugin (Easiest Way)
This is the method I recommend for most WordPress users. It takes about 2 minutes and you don’t need to touch any server files.
The best plugin for this is Ads.txt Manager by 10up. It’s free, has 1 million+ active installations, and is maintained by one of the most reputable WordPress development agencies.

Step 1: Install and Activate the Plugin
Go to your WordPress dashboard → Plugins → Add New. Search for “Ads.txt Manager” and click Install Now, then Activate.

Step 2: Add Your Authorized Seller Entries
After activation, go to Settings → Ads.txt. You’ll see a text editor where you paste your authorized seller lines.
For Google AdSense, paste the line you got from your AdSense dashboard:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0

Step 3: Save Changes
Click “Save Changes” and you’re done. The plugin automatically serves the file at yoursite.com/ads.txt — no file upload needed. If you use multiple ad networks, add each entry on a separate line.
This method is the cleanest because the plugin handles everything through WordPress’s rewrite system. No physical file is created on your server, which means no permission issues and no conflicts with caching plugins. If you’re looking to keep your WordPress setup lean, read my guide on techniques for a faster WordPress site.
Method 2: Add Ads.txt Manually via cPanel File Manager
Prefer not to install another plugin? You can add the ads.txt file directly to your server. This method requires access to your hosting control panel (cPanel, Plesk, etc.).
Step 1: Open File Manager
Log in to your hosting cPanel and click File Manager under the Files section.

Step 2: Create the Ads.txt File
Navigate to the public_html folder (this is your WordPress root directory). Click “+ File” in the top toolbar and create a new file named exactly ads.txt (all lowercase).
Open the file and paste your authorized seller entries — the same line(s) you’d use in the plugin method:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0

Step 3: Save and Verify
Click “Save Changes”. The file is now live at yoursite.com/ads.txt. You can verify it immediately by visiting that URL in your browser.
Important: The ads.txt file must be placed in the root directory of your domain — that’s
public_htmlfor most hosts. If you place it in a subdirectory (likepublic_html/blog/), it won’t work. Also make sure the file uses UTF-8 encoding without BOM — some text editors add invisible characters that break the file.
Method 3: Add Ads.txt via FTP Client
If your hosting doesn’t provide cPanel (common with cloud hosts like DigitalOcean, Vultr, or AWS), you can upload the file using an FTP client like FileZilla.
- Create a file called
ads.txton your local computer using any plain text editor (Notepad on Windows, TextEdit on Mac in plain text mode) - Paste your authorized seller entries and save the file
- Open FileZilla and connect to your server using your FTP credentials (hostname, username, password, port 21)
- Navigate to the root directory of your WordPress installation (usually
/public_html/or/var/www/html/) - Upload the
ads.txtfile from your local machine to the root directory - Verify by visiting
yoursite.com/ads.txtin your browser
This method gives you the most control, but it requires FTP credentials from your hosting provider. If you’re new to WordPress and FTP sounds intimidating, start with the plugin method above or check my WordPress tutorial for beginners.
How to Verify Your Ads.txt File Is Working
After adding the file using any method, you should always verify it’s accessible and correctly formatted.
Browser Check
The simplest test: open your browser and go to https://yoursite.com/ads.txt. You should see your authorized seller entries displayed as plain text.

Google AdSense Verification
Go back to your Google AdSense dashboard. The “Earnings at risk” warning should disappear within 24-48 hours after Google crawls your updated ads.txt file. If it persists after 48 hours, double-check that your publisher ID matches exactly.
Online Validators
You can use free online tools to validate your ads.txt file format:
- Ads.txt Guru — validates your file and checks for common formatting errors
- Ads.txt Validator — another free validator that catches encoding issues
Ads.txt Entries for Popular Ad Networks
If you use ad networks beyond Google AdSense, you’ll need to add their entries too. Here are the standard ads.txt lines for the most popular networks as of 2026:
| Ad Network | Ads.txt Entry Format |
|---|---|
| Google AdSense | google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0 |
| Google Ad Manager | google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0 |
| Ezoic | Provided in your Ezoic dashboard under Monetization → ads.txt |
| Mediavine | Provided after Mediavine approval — typically 50+ lines including resellers |
| AdThrive (Raptive) | Provided after acceptance — includes their direct and reseller entries |
| Amazon Associates | amazon-adsystem.com, XXXXXXXX, DIRECT |
| Media.net | Provided in your Media.net dashboard |
Each network provides their specific ads.txt entries in their publisher dashboard. When you join a new ad network, always ask for their ads.txt requirements and add the entries to your file.
Quick Tip: If you use Mediavine or Raptive, they provide a long list of reseller entries. Don’t be alarmed by 50-100+ lines — that’s normal. These are all the demand partners that bid on your ad inventory through their platform.
What About App-ads.txt?
If you have a mobile app (Android or iOS) that shows ads, you also need an app-ads.txt file. It works exactly the same way as ads.txt but is specifically for mobile app inventory.
The format is identical — same fields, same syntax. The only difference is the filename: app-ads.txt instead of ads.txt. The Ads.txt Manager plugin mentioned above also supports app-ads.txt files (look for the “App-ads.txt” tab in the plugin settings).
If you don’t have a mobile app, you can safely ignore this.
Common Ads.txt Errors and How to Fix Them
If your ads.txt file isn’t working after setup, check for these common issues:
| Error | Cause | Fix |
|---|---|---|
| “Earnings at risk” won’t go away | Google hasn’t re-crawled yet, or publisher ID doesn’t match | Wait 24-48 hours. Verify your pub-ID matches exactly what’s in AdSense → Account Info |
| 404 when visiting /ads.txt | File not in root directory, or WordPress rewrites not enabled | Make sure the file is in public_html (not a subfolder). If using the plugin, go to Settings → Permalinks and click “Save” to flush rewrites |
| Encoding errors | File saved with BOM or wrong encoding | Re-save as UTF-8 without BOM. Avoid using Microsoft Word — use Notepad, VS Code, or the WordPress plugin editor |
| Subdomain issues | File placed on www.site.com but domain resolves to site.com | Place the file on the exact domain your site uses. Check your WordPress Settings → General → Site URL |
| Multisite conflicts | WordPress multisite uses path-based URLs | Ads.txt only works at the root domain. If your multisite uses site.com/blog/, the file must be at site.com/ads.txt, not site.com/blog/ads.txt |
| Plugin conflict | Another plugin or security rule blocks the route | Temporarily deactivate security plugins (Wordfence, Sucuri) and test again. Some firewall rules block .txt file access |
If you’ve tried everything and it still isn’t working, the manual cPanel/FTP method is the most reliable fallback — it creates an actual file on the server that doesn’t depend on WordPress rewrites. This is similar to how you’d add meta tags in WordPress — sometimes the manual approach is the simplest.
Summing Up!
Adding ads.txt to WordPress takes less than 5 minutes and it’s something every publisher running ads should do immediately. The plugin method (Ads.txt Manager by 10up) is the easiest — install, paste your AdSense line, save. If you want to avoid plugins entirely, the cPanel or FTP methods work just as well.
The key things to remember: place the file at your root domain, use the exact publisher ID from your ad network dashboard, and verify it’s working by visiting yoursite.com/ads.txt in your browser. Google will pick it up within 48 hours and that “Earnings at risk” warning will disappear.
If you’re still setting up your monetization, start with my guide on how to get Google AdSense approval — then come back here to add your ads.txt file.