Post

PSA Googlebot tries to render pages to understand what they look like, to better understand the value & context of your site's content. This requires that your JS & CSS files be crawlable. Don't block these files for Googlebot in robots.txt, if you want Google to understand your site optimally.

8 reposts26 likes

I like to block Google Tag Manager. It doesn't change the look or feel of our website. However I heard that Chrome might be classifying pages as shopping or not. dejan.ai/blog/google-... So like it or not, I think it may be why you'll be seeing more blocking and/or dynamic rendering.

Google Tag Manager is on a different domain (normally) which means that domains robots.txt is what controls if it can be crawled or not. You can't decide that from your domain. Interestingly, quite a few tracking resources are crawlable. Chrome is not a bot and does not check robots.txt.

You're correct. I'm in the not-normal category. Our GTM has a JS dependency to fire. We block the JS there. Good point on the Chrome not being a crawler...

In the Search Console URL Inspection or Rich Result Test tools you can see if resources are blocked if you click View Crawled Page->More Info->Page Resources. The filter can be set to show successful resources as well.

I've found an over-obsession with "crawl budget" for smaller sites that really don't need to worry about it is often behind the thought process.

That's a huge challenge with technical SEO messaging, IMO -- what might be critically important for huge sites can be completely irrelevant for small-to-medium sites.

CSS & JS tend to be well-cachable (well, they should be), so this shouldn't be an issue for big sites either. (I know, I know, big sites can be very messy and all that, but the CSS isn't going to be their "only wafer thin mint")

Here's a possible example. 1. AI bots don't like javascript (someone only read a headline) 2. A game of telephone occurs. 3. If we block javascript on our robots.txt we're optimizing for AI bots! It's especially bad if the person giving the advice has a megaphone and an AI assistant references it.

That too! It was better known not to block these back when mobile-friendliness was a topic (you can't tell if it's mobile-friendly if you can't render it properly). It's one of those things that's obvious once you know, so it's good to post reminders from time to time :).

People do mysterious things :-). This used to make sense in the late 1900's, when crawlers might accidentally crawl a CSS or JS file and assume it's a text file that needs to be indexed.

Agreed but in cases where JS & CSS are in security sensitive folders still block folders but ALLOW JS and CSS and test it because sometimes the order of robots commands can affect the ability for those files to be indexed. I've seen lots of cases WP admin folders exposed for JS and CSS indexation.

I don't know React that well - you can roughly test by blocking the URL in Chrome dev-tools and reloading the page. If the content loads & displays, it's probably fine.