Adding .txt root file for validation

Topic summary

Ahrefs now supports IndexNow, but adding the required validation .txt file on Shopify requires a workaround since Shopify doesn’t allow direct root file editing.

Solution Steps:

  1. Create a .txt file manually using the key name and content provided by Ahrefs (note: Ahrefs only provides the key, not the file itself)
  2. Upload via Shopify Admin β†’ Content β†’ Files
  3. Shopify generates a CDN URL (e.g., https://cdn.shopify.com/s/files/…)
  4. Set up a redirect from the required Ahrefs URL to the Shopify CDN URL via Online Store β†’ Navigation β†’ Redirects

This approach mirrors the previous workaround used for robots.txt before Shopify allowed direct editing. A detailed guide is available demonstrating the complete process.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Ahrefs now support IndexNow. That is great. However, if you are using Shopify adding the required validation file is not so straight forward.

So, I have made this guide that will show you how to do this.

https://elevateapps.io/indexnow-ahrefs-shopify/

1 Like

Great info - thanks for sharing I still need to give that feature in Ahrefs a spin.

For my sanity and so I remember (lol) steps are:

  1. In Shopify Admin
  2. Go to Content > Files
  3. Create a .txt file
  4. Upload the file created from Ahrefs key
  5. Shopify will give a weird URL like:
    https://cdn.shopify.com/s/files/1/123456/456789/789123/files/s1srgp8p22s73cmw5rtjjyb1h3h6fgt2.txt?v=1720085085
  6. Go to Online Store > Nav > Redirects
  7. Add redirect from the Ahrefs required URL to this one.

Very similar to how you used to have to do a redirect as a workaround before Shopify allowed robots.txt editing directly.

Thanks :slightly_smiling_face:

Yes, except Ahrefs do not give you the file - only the key. You have to manually create the file, with the key-name.txt and the key as only content.