XF 2.2 Robots.txt file

Spartan

Well-known member
I got a message from Adsense saying my robots.txt file is preventing the from serving ads. I've have the same file since 2021.

What here could be causing the trouble?

User-agent: Mediapartners-Google
Disallow:

User-agent: *
Disallow: /whats-new/
Disallow: /account/
Disallow: /goto/
Disallow: /login/
Disallow: /posts/
Disallow: /admin.php
Disallow: /tags/
Disallow: /editprefix
Allow: /

Sitemap: https://syracusefan.com/sitemap.xml
 
I'm not sure if it makes a difference, but when I was using AdSense I had the following at the top of my robots.txt file. Basically, I used allow all rather than disallow blank.

Code:
User-agent: Mediapartners-Google
Allow: /

After a quick Google search, it looks like that disallow blank line is just ignored, so that's probably your issue. That line is ignored so then you're blocking it with the rest of the bots after that.

Screenshot_20250120-073356.webp
 
Thank you for your reply.

I've had this in my robots.txt file for years. All of the sudden, google says it's the problem. I'm deleting it, as the page below says, but don't understand why I've been getting Adsense ads all along (until a few days ago).

IMG_0850.webp
 
Back
Top Bottom