In the world of digital advertising, transparency and control over ad inventory are crucial. The ads.txt file, an initiative by the IAB Tech Lab, helps ensure that your digital ad inventory is only sold through authorized sellers. Here’s a detailed guide on how to create and upload an ads.txt file to your WordPress site using cPanel, Elementor, and the Astra theme.
Step-by-Step Guide
Create the ads.txt File:
Open a Plain Text Editor:
- Use Notepad (Windows) or TextEdit (Mac).
Paste Your Publisher ID:
- Paste the following line into the text editor, replacing
pub-0000000000000000
with your own publisher ID from your AdSense account:google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
- Paste the following line into the text editor, replacing
Save the File:
- Save the file as
ads.txt
.
Log in to cPanel:
Access cPanel:
- Navigate to
yourdomain.com/cpanel
.
- Navigate to
Enter Credentials:
- Log in with your cPanel username and password.
Upload the ads.txt File to Your Root Directory:
Open File Manager:
- In cPanel, go to the File Manager.
Navigate to Root Directory:
- Locate your website’s root directory, typically named
public_html
or your domain name.
- Locate your website’s root directory, typically named
Upload the File:
- Click on the
Upload
button at the top. - Select the
ads.txt
file you created and upload it to the root directory.
- Click on the
Verify the Upload:
- Check in Browser:
- Verify the upload by navigating to
https://yourdomain.com/ads.txt
in your web browser. - If the file displays correctly, the upload was successful.
- Verify the upload by navigating to
Confirm with AdSense:
Log in to AdSense:
- Sign in to your AdSense account.
Address Alerts:
- If there’s an alert about ads.txt, click on it and follow the instructions to notify AdSense that the file has been uploaded.
Manual Check:
- Manually check for updates in AdSense by navigating to
Sites
, selecting your site, and clickingCheck for updates
.
- Manually check for updates in AdSense by navigating to
Tips for Security and Network Maintenance:
Keep Backups:
- Always keep a backup of your website and any important files before making changes.
Use Secure FTP:
- If you are not comfortable using cPanel, consider using a secure FTP client like FileZilla to upload the ads.txt file securely.
Regular Updates:
- Ensure your WordPress installation, themes, and plugins are always up to date to avoid security vulnerabilities.
Monitor Your Site:
- Regularly monitor your site’s performance and security using plugins like Wordfence or Sucuri.
Tips for Security and Network Maintenance:
Keep Backups:
- Always keep a backup of your website and any important files before making changes.
Use Secure FTP:
- If you are not comfortable using cPanel, consider using a secure FTP client like FileZilla to upload the ads.txt file securely.
Regular Updates:
- Ensure your WordPress installation, themes, and plugins are always up to date to avoid security vulnerabilities.
Monitor Your Site:
- Regularly monitor your site’s performance and security using plugins like Wordfence or Sucuri.
By following these steps, you can successfully add an ads.txt file to your WordPress site, helping protect your ad inventory and maximize your revenue potential.