If you display ads using platforms like Google AdSense, you will need to add an ads.txt file with specific codes on your WordPress website.
This simple text file, placed at the root of your domain, publicly declares which ad networks are authorized to sell inventory on your site.
Without the ads.txt file, unauthorized or fraudulent sellers might try to profit from your content. It can result in misleading ads, reduced earnings, or even trust issues with your audience and advertisers.
In this complete guide, I will go through what the ads.txt file does, why it’s critical for monetized sites, and how to add and manage it correctly.
What is Ads.txt File?
The ads.txt file stands for Authorized Digital Sellers and was introduced by the Interactive Advertising Bureau (IAB) as a transparency initiative in the digital advertising ecosystem. It’s a plain text file you upload to the root directory of your website to publicly declare which advertising companies are authorized to sell or resell ad inventory on your behalf.
This small file acts as a verified list of ad vendors you trust. By maintaining it correctly, you can protect your ad space from counterfeit inventory being sold across unauthorized channels.
The ads.txt file follows a simple format, with each line listing:
domain name, publisher ID, relationship type, certification ID (optional)
Here’s an example for Google AdSense:
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
Each part of the line is important:
- Domain name of the advertising system (like google.com)
- Publisher ID associated with your account
- Relationship type — typically
DIRECT
(if you work directly with the platform) orRESELLER
(if someone else sells on your behalf) - Certification ID (optional but recommended)
How Does Ads.txt Work?
Once added to your website, the ads.txt file becomes publicly accessible via yourdomain.com/ads.txt
. Advertisers and ad exchanges regularly crawl this file to verify if they are authorized to serve ads on your site.
If your details are missing or incorrect, platforms like Google AdSense might restrict your ad revenue or even display warnings.
This simple file has become a standard requirement for sites using display ads, especially when using services like AdSense, Ezoic, or Media.net.
Steps to Add Ads.txt File in WordPress
Adding an ads.txt file to your WordPress site is a straightforward process, but the exact steps can vary depending on how you choose to implement it.
You can either use WordPress plugins for convenience or manually upload the file via FTP or your hosting File Manager.
Here’s a breakdown of both approaches to help you decide what works best for your setup.
Step 1: Create Your Ads.txt File
Before adding the file to your website, you need to create it. Use any plain text editor like Notepad (Windows) or TextEdit (Mac) and follow the required format for each line:
advertising-platform.com, publisher-id, relationship-type, certification-authority-id (optional)
For Google AdSense, it would look something like:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
Make sure to use your actual Publisher ID from your AdSense account. Save the file as ads.txt
(not .txt.txt
).
Step 2: Choose a Method to Upload the File
Once your file is ready, you can add it to your WordPress site using either of these methods:
- With a WordPress plugin (ideal for beginners)
- Without a plugin (manual method using FTP or File Manager)
Each method is explained in detail in the next sections. If you’re not comfortable using FTP or accessing your hosting server, using a plugin is the easier and safer choice.
Step 3: Verify the Ads.txt File is Live
After uploading the file, check if it’s live by visiting:
https://yourwebsite.com/ads.txt
You should see the contents of your file displayed in plain text. If the page shows a 404 error or nothing loads, go back and verify the file location or check your plugin settings.
Add Ads.txt File in WordPress Using Plugin
If you’re looking for the easiest and most beginner-friendly way to add an ads.txt file to your WordPress site, using a plugin is the best route.
With the right plugin, you won’t need to access your site files or use FTP. Everything can be managed right from your WordPress dashboard.
Recommended Plugin: Ads.txt Manager by 10up
The Ads.txt Manager plugin developed by 10up is a very well trusted solution that allows you to create and manage your ads.txt file directly within WordPress.
Install and Configure the Plugin to Add Ads.txt Info
- Install the Plugin – Download it here or from your dashboard.
- Go to your WordPress admin dashboard.
- Navigate to Plugins → Add New.
- Search for Ads.txt Manager.
- Click Install Now, then Activate.
- Access Plugin Settings
- After activation, go to Settings → Ads.txt in your admin sidebar.
- You’ll see a simple editor where you can add your ad network entries.
- Add Entries to Ads.txt
- Use the format required by the IAB:
advertising-platform.com, publisher-id, DIRECT or RESELLER, certification-authority-id
- Example for AdSense:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
- Use the format required by the IAB:
- Save Changes
- Once you’ve added all your authorized sellers, click Save.
- Your ads.txt file is now live and accessible at:
https://yourdomain.com/ads.txt
Why Use Plugins to add Ads.TXT File?
- No coding or FTP access required
- Instant changes—edit, add, or remove entries anytime
- Prevents syntax errors by following a validated format
- Secure and built by a reputable developer team
If you are looking for more plugin options or use one already, you might also be able to add the Ads.TXT file with the popular WPCode plugin.
Plugins are particularly helpful if you’re managing multiple ad networks. You can list each one on a new line, making it easy to update as your monetization strategy evolves.
How to Add Ads.txt File in WordPress Without Plugin
If you prefer not to use a WordPress plugin, you can still add the ads.txt file manually. This method gives you full control but requires access to your site’s hosting server—either via an FTP client like FileZilla or through your web host’s File Manager.
Before you start, make sure you have the following:
- A ready-to-upload
ads.txt
file (created using Notepad or any plain text editor). - Access to your website files via FTP or hosting panel (like cPanel).
- FTP login credentials or File Manager access from your hosting provider.
Method 1: Using an FTP Client
- Open Your FTP Client
- Install and launch an FTP tool like FileZilla.
- Enter your FTP details (host, username, password, port) and click Quickconnect.
- Navigate to the Root Directory
- On the right pane (remote site), locate your website’s root folder. This is usually named
public_html
or may be your domain name.
- On the right pane (remote site), locate your website’s root folder. This is usually named
- Upload the ads.txt File
- On the left pane (local site), locate your saved
ads.txt
file. - Drag and drop the file into the root directory on the right side.
- On the left pane (local site), locate your saved
- Confirm Upload
- Once the transfer is complete, visit
https://yourwebsite.com/ads.txt
in a browser. - If you see your ad entries displayed, the upload was successful.
- Once the transfer is complete, visit
See the upload confirmation screenshot using Cyberduck, popular FTP client for Mac.
Method 2: Using File Manager in cPanel
- Login to Your Hosting Panel
- Go to your hosting provider’s dashboard and open File Manager (usually under the Files section).
- Open Public_HTML Directory
- In the File Manager, locate the
public_html
directory or the main directory of your domain.
- In the File Manager, locate the
- Upload the File
- Click Upload, then select your
ads.txt
file from your computer. - Once uploaded, confirm that it appears in the file list.
- Click Upload, then select your
- Verify the File
- Open a new browser tab and go to
https://yourdomain.com/ads.txt
. - You should see your ads.txt content live.
- Open a new browser tab and go to
This manual method is perfect if you’re comfortable handling backend tasks or if your WordPress environment restricts plugin use.
How to Add Ads.txt File in WordPress for AdSense
If you’re using Google AdSense to monetize your WordPress site, adding the correct ads.txt entry is essential. Google may display a warning in your AdSense dashboard that reads:
Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID.
Ignoring this can limit your earnings or stop ads from serving properly. Here’s how to add the correct AdSense entry to your ads.txt file using either a plugin or manual upload.
Step 1: Locate Your AdSense Publisher ID
To add the correct line, you need your Publisher ID. Here’s how to find it:
- Sign in to your Google AdSense account.
- Go to Account > Account Information from the left-hand menu.
- Copy your Publisher ID, which looks like
pub-1234567890123456
.
You can also download your personalized ads.txt file directly from AdSense:
- Navigate to Sites.
- If there’s a warning, click Fix now.
- Click Download to get your ready-made ads.txt file.
Step 2: Add the AdSense Entry to Ads.txt
If you’re using the Ads.txt Manager plugin, follow these steps:
- Go to Settings → Ads.txt in your WordPress dashboard.
- Paste the following line (replace with your actual ID):
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
- Click Save Changes.
If you’re uploading the file manually:
- Add the same line to your
ads.txt
file using Notepad or any text editor. - Upload it to your website’s root directory using FTP or File Manager.
Step 3: Verify and Monitor Changes
After updating the file, go to:
https://yourwebsite.com/ads.txt
Make sure your AdSense entry is visible in the browser. If the warning still appears in your AdSense dashboard, wait 24–48 hours as it may take time for changes to reflect.
Regularly check your AdSense account to ensure there are no issues with your ads.txt configuration. Correct implementation helps maintain your revenue flow and avoids any unnecessary disruptions.
How to Check If Ads.txt is Working?
Once you’ve added the ads.txt file to your WordPress site, you should verify that it’s accessible and correctly formatted. This step ensures ad platforms like Google AdSense can read and validate your authorized sellers. If the file isn’t working as expected, your ads could stop displaying or your earnings may be impacted.
Step 1: Open the Ads.txt File in Your Browser
The simplest way to check your file is by visiting the direct URL:
https://yourdomain.com/ads.txt
Replace yourdomain.com
with your actual domain name. If the file is working, your browser will display all the lines you added—each entry on its own line.
Step 2: Check for 404 or Permission Errors
If you see a 404 error or a blank page:
- Double-check that the file was uploaded to the root directory (not a subfolder).
- Make sure the filename is exactly
ads.txt
(all lowercase). - If using a plugin, ensure the settings were saved properly and there are no caching issues.
Step 3: Use Google’s AdSense Validator
If you’re running AdSense, you can verify your implementation inside your Google AdSense dashboard:
- Go to the Sites section.
- If there’s an issue, you’ll see an alert next to your domain.
- Click Fix Now to view more details and suggested actions.
Step 4: Use Online Validators from Ads Networks
You can also use free online tools to validate your ads.txt file from different Ad Networks. These tools can highlight:
- Formatting errors
- Invalid characters
- Duplicate entries
Many ad networks provide their own validation tools or alerts if they can’t read your ads.txt properly.
Once you’ve confirmed the file is working, your site is better protected from ad fraud, and you can maximize your ad revenue with confidence.
Why is Ads.txt File Necessary?
Adding an ads.txt file to your WordPress site is not just a best practice—it’s essential if you rely on digital ads for revenue. It ensures transparency in your ad ecosystem and helps maintain the integrity of your website’s ad inventory.
Protects Your Ad Revenue from Fraud
Without an ads.txt file, unauthorized sellers could misrepresent themselves as you and sell fake or low-quality ad space. This ad fraud can lead to serious revenue loss and damaged trust with ad networks. By listing only approved sellers, the ads.txt file protects you from such manipulation and ensures the money flows to you—not to scammers.
Builds Trust with Advertisers and Networks
Ad networks and advertisers prefer working with publishers who have properly configured ads.txt files. It gives them confidence that their ads are appearing in legitimate spaces. Google, for instance, actively checks ads.txt files to validate sellers. If your file is missing or misconfigured, your earnings could be affected, or worse, your ads may stop serving.
Avoids “Earnings at Risk” Errors in AdSense
If you’re using Google AdSense and haven’t added your publisher ID to your ads.txt file, you’ll likely encounter a warning message:
“Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID.”
Fixing this involves simply updating the file with the correct AdSense entry, and the warning usually disappears within a few hours.
Offers Better Control Over Who Can Sell Ads
The ads.txt file is completely managed by you. This gives you the power to decide which platforms or resellers have permission to monetize your site. You can update or remove entries at any time, helping you stay in full control of your advertising partnerships.
Helps Maintain a Clean, Compliant Web Presence
Following IAB standards by using an ads.txt file reflects your commitment to responsible monetization practices. It keeps your website compliant with industry norms and enhances your credibility with current and potential advertisers.
Conclusion
Adding and managing an ads.txt file in WordPress is a simple yet powerful step that helps you protect your ad revenue, build advertiser trust, and comply with industry standards.
Whether you monetize your site through Google AdSense or other ad networks, having a properly configured ads.txt file ensures only verified partners can sell your ad space.
Both methods (adding with a plugin like Ads.txt Manager or manually via FTP or File Manager) that we discussed in this guide work effectively as long as the file is added to the root of your domain and includes accurate publisher details.
Make sure to keep your ads.txt file up to date, especially when you change ad partners or add new networks. A small mistake, such as a missing publisher ID, could lead to warnings like “Earnings at risk” and even lost revenue. So make it a habit to check your file regularly!