Easy Tech Tuts
Squarespace

How to Add Ads txt To Squarespace Site for Google Adsense Easily 2026

By Impran M N

Google AdSense requires an ads.txt file at your domain's root, which is tricky on Squarespace's free plan since it doesn't allow direct root access. This guide covers two methods: uploading the file as a link with a URL mapping, and hosting it on GitHub as a more reliable alternative.

01Create your ads.txt file

Open a text editor, paste the code provided by Google AdSense with your publisher ID, and save the file as ads.txt.

02Upload the file in Squarespace

Go to Pages, add a new Link, choose the File option, and upload your ads.txt file, then copy the resulting file link.

03Map the URL to your root domain

Go to Settings, then Advanced, then URL Mappings, and add a redirect from /ads.txt to your uploaded file link.

04Test the setup

Open yourdomain.com/ads.txt in a private browser window to confirm the file loads correctly.

05Use GitHub if the static method fails

If the redirect doesn't work, create a free GitHub repository, upload your ads.txt file, and copy the raw file URL.

06Redirect to the GitHub-hosted file

Add the same URL mapping in Squarespace, pointing /ads.txt to the raw GitHub URL, so AdSense can access it publicly.

FAQ

Frequently asked questions

Can I add ads.txt on Squarespace's free plan?

Yes, you can upload the file as a downloadable link and use a URL mapping redirect, even on the free plan.

What if the static Squarespace method doesn't work?

Hosting the ads.txt file on GitHub and redirecting to its raw URL is a more reliable alternative.

How do I test if my ads.txt file is working?

Open yourdomain.com/ads.txt in a private or incognito browser window to check whether the content loads.

Where do I set up the URL mapping in Squarespace?

URL mappings are configured under Settings, then Advanced, then URL Mappings.

Is the GitHub method free to use?

Yes, creating a public GitHub repository to host your ads.txt file is free.

Watch the full walkthrough

The same steps, demonstrated on screen from start to finish.