• Hi,

    I know you’ve done a lot of research for the robots.txt rules, but I’ve noticed an issue with the current settings.

    In Google’s Mobile-Friendly Test my site was showing as not mobile friendly even though it is responsive.

    The problem was that my CSS and JS was loading from /wp-content/cache/swift-performance/ and was being blocked because of the rule “Disallow: /wp-content/cache”.

    From what I could find online the rules “Allow: /*.css” and “Allow: /*.js” don’t work because:
    a. they only allow CSS and JS from the root directory
    b. Google gives priority to the longer rule between allow and disallow.

    The allow rules would instead need to be as per below, but you’d need to do this for images, CSS, JS, etc. for each disallow folder that may appear in the source code (e.g. without caching CSS may be loaded from /wp-content/plugins).

    Allow: /wp-content/cache/*.css
    Allow: /wp-content/cache/*.js

Viewing 1 replies (of 1 total)
  • Ни,

    Yes the question about robots.txt was already, we will update it to the current version on the recommendations of yoast. Now we have prepared a number of large updates and useful tools, next week we will download this update and solve all the accumulated problems.

    Thanks for the detailed report!

    Best regards, Alex

Viewing 1 replies (of 1 total)

The topic ‘Robots.txt blocking CSS and JS’ is closed to new replies.