How to Make an Ads.txt File for Adsense on WordPress

How to Make an Ads.txt File for Adsense on WordPress

Authorized Digital Sellers, or ads.txt is an IAB initiative that helps ensure that your digital ad inventory is only sold through sellers (such as AdSense) who you’ve identified as authorized. Creating your own ads.txt file gives you more control over who’s allowed to sell ads on your site and helps prevent counterfeit inventory from being presented to advertisers.

Google Adsense strongly recommend that you use an ads.txt file. It can help buyers identify counterfeit inventory and help you receive more advertiser spend that might have otherwise gone toward that counterfeit inventory.


Stage 1: Make the ads.txt file for Adsense

1. Right-click on the desktop then select New → Text Document.

ads.txt wordpress

2. Give the name to ads only (no need to add “.txt” because the format is already like this).

ads.txt wordpress

3. Download “File” below. Open and Copy one of the following lines of code based on the status of your publisher.



Confused? Next I describe the code definition:  –  because it is a Google service, the domain is automatically You don’t need to change this value if you use Google Adsense or Doubleclick.

pub-00000000000000  –  is your publisher code that can be found on the Adsense → Account → Account Information → Publisher ID page. Please change with your code.

DIRECT  –  gives a signal that you are a publisher who has complete control of the account but does not sell ad slots to third parties (the average publisher is this type).

RESELLER  –  means you are a publisher who also sells ad slots to third parties (usually only done by large publishers).

f08c47fec0942fa0 – is the identification code for Google. You don’t need to change this code.

So, you only need one line: whether it’s DIRECT or RESELLER.

ads.txt wordpress

4. If so, click File → Save (CTRL + S) the file.


Stage 2:

1- Uploading ads.txt file to WordPress without plugin

Because this addition is very minor, it would be better if you don’t rely on plugins. Because, the fewer plugins mean WordPress is getting lighter.

1. Go to your “cPanel” page then select File Manager.

Usually, cPanel can be accessed via the address “”

membuat ads.txt di WordPress

2. If you have so many site, Then in the folder list, double-click on the site directory that you want to install ads.txt

membuat ads.txt di WordPress

or Click “public_html” if it’s your main site

Related image

3. After logging in, click the “Upload” menu.

membuat ads.txt di WordPress

4. Upload the ads file that you created earlier. Can be dragged or through “Select File”.

membuat ads.txt di WordPress

5. If it has been uploaded, go back to the “File Manager” page then click “Reload”.

membuat ads.txt di WordPress

You should see one of the files named ads.txt as follows.

membuat ads.txt di WordPress


2- Uploading ads.txt file to WordPress Using the plugin

Another way is to use a special plugin to implement the ads.txt code. You can use this method if you don’t really understand using cPanel.

1. Install the plugin called “Ads.txt Manager” on your WordPress site.

2. Then, enter “Settings” → “Ads.txt” → enter your “ads.txt” code.

membuat ads.txt di WordPress

3. Finally, Save Changes.

NOTE: This plugin does not yet support WordPress multisite. So from that method by uploading the ads.txt file to the File Manager it is recommended to multisite.


Step 3: Check the installed ads.txt file

To check whether the ads.txt file is accessible, you can visit the site using the format “”

There will appear the ads.txt code that has been installed.

To see any writing errors in the code, you can use tools called Ads.txt Validator.

ads.txt validation

Enter your WordPress address, then click “Get Your Free Report”.

Ads.txt Validator will tell whether it is valid or not. If not, you will also be informed of the source of the problem and its resolution.

Leave a Reply

error: Content is protected !!
%d bloggers like this: