Closed ginocremer closed 1 year ago
I just tried with an unmodified WP site, only Cachify enabled. This results in a generated robots.txt like this:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: http://10.100.2.1/wp-sitemap.xml
Disallow: */cache/cachify/
(the */cache/... is from current Cachify development version, previously it was /wp-content/cache/...)
Up to WordPress 5.4 (without the built-in sitemap feature), I guess the result was valid:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: */cache/cachify/
The sitemap is hooked in with priority 0
[1], our integration with default 10
:
https://github.com/pluginkollektiv/cachify/blob/aa835ce63d87b937c4eb26e5cc1dfe40d7a072be/inc/class-cachify.php#L174
Theoretically we can go to -1 or even lower, s.t. the line is printed before the sitemap, so it's a valid block again. But in general we don't know, what any other component might have contributed to robots.txt, so maybe it's better to always generate a complete block like
User-agent: *
Disallow: */cache/cachify/
That's probably the best idea, always adding the User-agent
to our rules.
Should be fixed by #283
Hi Cachify team, Cachify writes a line in robots.txt since 2.1.9:
Disallow: /wp-content/cache/cachify/
However, Pagespeed Insights now criticises (and deducts points accordingly) that "no user-agent was specified".
How can this be corrected accordingly? We have only seen that the line is written in the plugin code. But indeed without a user agent.
Thanks for your feedback and kind regards.
I think it could also be something in combination with Yoast SEO.
If I open Yoast SEO Robots.txt editing tool and I click on save....the line from Cachify disappears:
Now I can directly write the Cachify-Line in robots.txt - and the error in pagespeed insights disappears also:
But I would like to have rather a solution that works directly without editing manually the robots.txt file via Yoast SEO.