How to add Ads.txt in the NextJS project to fix the AdSense alert?

quizzesforyou.com
2 min readJul 29, 2023

In a new website, once Google AdSense approves the website for Ads, getting the below warning message to add “Ads.txt” is very common. In this article let's see how “Ads.txt” can be added to a NextJS project.

What is Ads.txt?

Below is the definition from the AdSense link

Authorised Digital Sellers or ads.txt is an IAB Tech Lab initiative that helps ensure that your digital ad inventory is only sold through sellers (such as AdSense) who you’ve identified as authorized.

How to fix Ads.txt issue?

  1. create ads.txt in the root path of the NextJS project.
touch ads.txt   // note the case of ads.txt file

2. Sign in to your AdSense account.

3. Click “Sites” on the sidebar

4. Select the site with the ‘Not found’ ads.txt status.

--

--