How to Add Ads.txt File in WordPress
- Sophie Ricci
- Views : 28,543
Table of Contents
What Is an Ads.txt File and Why It Matters
You’ve spent months building your WordPress site. You’re running ads, getting traffic, monetizing your content. Then you find out fraudsters are spoofing your inventory and pocketing your ad revenue behind your back.
That’s not a hypothetical. It happens every day, to sites just like yours.
Ads.txt — short for Authorized Digital Sellers — is the fix. It’s a simple text file you place on your website that tells advertisers exactly which platforms and sellers are authorized to sell your ad inventory. No more fraud. No more spoofing. Just legitimate, verified ad sales.
The numbers make the problem impossible to ignore:
- Ad fraud cost the global digital advertising industry an estimated $88 billion in 2023, up from $81 billion the year before (Juniper Research).
- Domain spoofing — where fraudsters sell fake ad inventory under your domain name — is one of the most common attack vectors.
- Sites with ads.txt files in place see measurably higher CPMs because premium advertisers actively filter for authorized inventory.
- As of 2022, over 80% of the top 1,000 publishers had adopted ads.txt, making it an industry standard expectation (IAB Tech Lab).
- Google AdSense, Google Ad Manager, and most major programmatic platforms now warn buyers against purchasing non-ads.txt authorized inventory, directly impacting your fill rates if you don’t have the file set up.
The bottom line: if you’re running ads on your WordPress site and don’t have an ads.txt file, you’re leaving money on the table and opening the door to fraud.
Let’s fix that right now.
What Goes Inside an Ads.txt File
Before you create anything, it helps to understand what the file actually contains.
An ads.txt file is a plain text file hosted at the root of your domain (e.g., yourdomain.com/ads.txt). Each line inside it follows a specific format:
<SSP/Exchange Domain>, <Publisher ID>, <Relationship Type>, <Certification Authority ID>
A real example looks like this:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Here’s what each part means:
- SSP/Exchange Domain — the ad network or exchange selling your inventory (e.g., google.com, appnexus.com)
- Publisher ID — your unique account ID with that network
- Relationship Type — either DIRECT (you have a direct relationship with the exchange) or RESELLER (a third party is selling on your behalf)
- Certification Authority ID — an optional but recommended tag ID that helps verify the exchange is legitimate
Most publishers start with a single line for Google AdSense and expand from there as they add networks.
How to Get Your Ads.txt Content
Before you add the file to WordPress, you need the actual content to put in it.
If you use Google AdSense:
- Log into your AdSense account
- Go to Sites → Your site
- AdSense will show you a warning if ads.txt is missing and will provide your exact ads.txt line to copy
It looks something like this:
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
Copy that line. That’s the minimum you need to get started.
If you use multiple ad networks, each network will provide their specific ads.txt line inside their publisher dashboard. Collect all of them before proceeding.
Method One: Add Ads.txt Using a WordPress Plugin
This is the fastest method and the one most site owners should use. No file manager access needed. No FTP client. Just a plugin.
Step One: Install the Ads.txt Manager Plugin
- Go to your WordPress dashboard
- Navigate to Plugins → Add New
- Search for “Ads.txt Manager”
- Install and activate it (the plugin by 10up is the most widely trusted option)
Step Two: Add Your Ads.txt Content
- Once activated, go to Settings → Ads.txt
- You’ll see a text area where you can paste your ads.txt content
- Paste in your lines (one per ad network, one per line)
- Click Save Changes
That’s it. The plugin automatically creates and serves your ads.txt file at yourdomain.com/ads.txt.
Step Three: Verify It’s Live
Open a new browser tab and type: https://yourdomain.com/ads.txt
You should see your ads.txt content displayed as plain text. If you do, you’re done.
Why this method works well:
- No need to touch server files
- Updates are instant through the dashboard
- Works on virtually every hosting setup
- Handles multisite WordPress installations cleanly
Method Two: Add Ads.txt Manually via the Root Directory
If you prefer direct control, or if a plugin isn’t available to you, this method works just as well.
Step One: Create the Ads.txt File
On your local computer, open any plain text editor (Notepad on Windows, TextEdit on Mac — make sure it’s set to plain text mode).
Create a new file and add your ads.txt content:
google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
Add additional lines for any other ad networks you work with.
Save the file as ads.txt (not ads.txt.txt — make sure the extension is correct).
Step Two: Upload the File to Your Root Directory
Your root directory is the main folder for your website, typically named public_html or www.
You can upload the file using:
- cPanel File Manager (provided by most hosting companies)
- FTP client like FileZilla
- SFTP if you have SSH access
Using cPanel File Manager:
- Log into your hosting control panel
- Open File Manager
- Navigate to your root folder (public_html)
- Click Upload and select your ads.txt file
- Once uploaded, confirm it appears in the root directory
Step Three: Verify
Visit https://yourdomain.com/ads.txt in your browser. Your file content should appear immediately.
Method Three: Add Ads.txt Using Your Hosting Dashboard
Many popular hosting providers now offer a dedicated ads.txt field directly inside their dashboard, without any file upload required.
WP Engine: Navigate to your install’s settings and look for the Ads.txt section.
Cloudways: Use the Application Management panel where you can add ads.txt content directly.
Kinsta: Through the MyKinsta dashboard under your WordPress install settings.
If your host offers this feature, it’s the cleanest approach — no plugins, no FTP, no manual file management.
Method Four: Add Ads.txt for WordPress Multisite
Multisite WordPress setups require a slightly different approach because subdomain and subdirectory sites share a single root.
The challenge: Each site in a multisite network technically needs its own ads.txt, but they may all share the same document root.
The fix:
If you’re using subdomain multisite (e.g., site1.yourdomain.com, site2.yourdomain.com), each subdomain can have its own ads.txt file placed in its respective directory.
If you’re using subdirectory multisite (e.g., yourdomain.com/site1/), the ads.txt file lives at the root (yourdomain.com/ads.txt) and applies network-wide.
The Ads.txt Manager plugin by 10up handles WordPress multisite natively and lets you manage individual ads.txt settings per site within the network — the simplest solution for complex setups.
Common Ads.txt Errors and How to Fix Them
Even with a simple file, things can go wrong. Here are the most common issues and how to resolve them fast.
Error: Ads.txt file not found
This almost always means the file was uploaded to the wrong directory. Double-check that it’s in your root folder (public_html), not inside a subfolder like /wp-content/.
Error: Ads.txt contains issues (Google AdSense warning)
AdSense flags this when lines are formatted incorrectly. Check for:
- Extra spaces or blank lines
- Missing commas between values
- Incorrect publisher ID
Cross-check your line against what AdSense shows in your account settings.
Error: Multiple ads.txt files detected
This happens when both a plugin and a manually uploaded file exist simultaneously. Remove one. The plugin-managed version is usually easier to maintain going forward.
Error: Ads.txt not updating
Browser caching can make it look like changes haven’t taken effect. Try opening the URL in an incognito window or clearing your cache. Server-side caching from your hosting provider can also cause delays of up to a few minutes.
Warning: Missing ads.txt — demand reduction risk
This is Google’s way of saying buyers are deprioritizing your inventory. Adding your ads.txt file immediately resolves this. Publishers who add ads.txt consistently report recovering ad fill rates within 24-48 hours.
How to Validate Your Ads.txt File After Setup
Don’t just assume it’s working. Validate it.
Method 1: Direct URL Check
Visit https://yourdomain.com/ads.txt and confirm your content appears exactly as expected.
Method 2: Google AdSense Dashboard
Log into AdSense and check the Sites section. The ads.txt warning should disappear within 24 hours of a correctly configured file going live.
Method 3: IAB Ads.txt Validator
The IAB Tech Lab offers a free validation tool that scans your ads.txt file for formatting errors and confirms it’s accessible.
Method 4: Google’s Rich Results Test
While not specific to ads.txt, checking your site’s crawlability and HTTP headers at yourdomain.com/ads.txt ensures the file is serving with a 200 OK status code. A 404 means it’s not found; a 301 redirect means buyers won’t read it properly.
Ads.txt Best Practices for Maximum Ad Revenue
Getting the file live is the first step. Keeping it optimized is what separates sites earning strong CPMs from those leaving money behind.
Keep it updated. Every time you add or remove an ad network, update your ads.txt file. Stale entries can create errors that reduce your fill rate.
Use DIRECT and RESELLER accurately. Mark relationships incorrectly and you’ll confuse buyers, reduce trust scores, and lower bids on your inventory.
Include all your networks. Studies show that publishers with complete, up-to-date ads.txt files earn up to 23% more in programmatic revenue compared to those with incomplete files (IAB research).
Don’t copy generic ads.txt files from the internet. Some guides suggest using template files with publisher IDs that aren’t yours. This creates conflicts and can actually suppress your revenue.
Review quarterly. Ad tech partnerships change. Make reviewing your ads.txt file part of your quarterly site maintenance routine.
The Bigger Revenue Picture: Ad Revenue vs. Direct Outbound
Here’s something worth thinking about: ads.txt protects your programmatic ad revenue. But ad monetization, even when optimized, has a ceiling.
The average display CPM across most content niches sits between $1 and $5. Programmatic ad revenue typically requires hundreds of thousands of monthly visitors to generate meaningful income — and that income is entirely dependent on ad market conditions, which fluctuate constantly.
Meanwhile, the businesses that consistently generate the most revenue from their online presence aren’t just running ads. They’re running active outbound strategies that convert their audience and traffic into direct client relationships.
That’s a conversation worth having if you’re serious about scaling your revenue beyond what ads can deliver.
Conclusion
Adding an ads.txt file to your WordPress site is one of the highest-ROI tasks you can complete in under five minutes. It protects your ad revenue, improves your standing with programmatic buyers, and signals to the market that your inventory is legitimate and verified.
The process is straightforward: get your publisher IDs from your ad networks, add them to a simple text file, and upload it to your site’s root directory — or use a plugin if you prefer staying inside the WordPress dashboard.
With ad fraud costing publishers tens of billions each year, and premium buyers actively filtering for ads.txt authorized inventory, this isn’t optional housekeeping. It’s essential infrastructure for anyone running a monetized WordPress site.
Set it up today. Verify it’s live. Then review it every time your ad network partnerships change.
Your ad revenue will thank you for it.
🚀 Turn Traffic Into Booked Meetings We build complete outbound
systems — targeting, campaigns, and scaling — that land you qualified meetings every week.
7-day Free Trial |No Credit Card Needed.
FAQs
How does fixing ads.txt connect to getting more qualified leads for my business?
Do I need to add ads.txt if I only use one ad network?
Will adding ads.txt slow down my WordPress site?
What happens if I don't add an ads.txt file?
We deliver 100–400+ qualified appointments in a year through tailored omnichannel strategies
- blog
- Sales Development
- How to Add Ads.txt File in WordPress