Are you seeing an error message saying “Googlebot cannot access CSS and JS files” on your WordPress site? Do not worry, you are not alone. This is a common issue many website owners face.

Credit: www.wpbeginner.com

Credit: mcstarters.com
Why This Error Happens
Googlebot needs access to your CSS and JS files to understand your website. These files help it see how your site looks and works. If Googlebot cannot access them, it may affect your site’s ranking.
Steps to Fix the Error
Follow these steps to fix the error. They are easy to follow, even if you are new to WordPress.
1. Check Your Robots.txt File
Your robots.txt
file tells search engines what they can and cannot access. If this file blocks Googlebot from CSS and JS files, you need to change it.
- Log in to your WordPress dashboard.
- Go to Settings > Reading.
- Make sure the option “Discourage search engines from indexing this site” is unchecked.
- Save changes.
- Now, go to Tools > File Editor or use an FTP client to access your
robots.txt
file. - Check for any lines that block Googlebot from accessing your
wp-includes
orwp-content
folders. - If you find such lines, delete them or change them to allow access.
- Save the file and upload it back to your server if you used an FTP client.
2. Use Google Search Console
Google Search Console is a free tool that helps you monitor your website’s presence in Google search results.
- Log in to your Google Search Console account.
- Select your website.
- Go to the Crawl section and click Fetch as Google.
- Enter your site’s URL and click Fetch.
- Click Submit to index.
- Google will now try to crawl your site again.
3. Check For Plugin Conflicts
Sometimes, plugins can block Googlebot. Deactivate all your plugins and see if the error goes away. If it does, activate each plugin one by one to find the one causing the problem.
- Go to your WordPress dashboard.
- Navigate to Plugins > Installed Plugins.
- Deactivate all plugins.
- Check if the error still appears.
- If the error is gone, activate each plugin one by one.
- Check for the error after activating each plugin.
- Once you find the problematic plugin, contact its support or find an alternative.
4. Check Your Theme
Your WordPress theme might also block Googlebot. Switch to a default theme like Twenty Twenty-One and see if the error goes away.
- Go to your WordPress dashboard.
- Navigate to Appearance > Themes.
- Activate a default theme like Twenty Twenty-One.
- Check if the error still appears.
- If the error is gone, your theme is the problem.
- Contact your theme’s support or find a new theme.
5. Check File Permissions
Your CSS and JS files need correct permissions. If they do not have the right permissions, Googlebot cannot access them.
- Log in to your hosting account’s file manager or use an FTP client.
- Navigate to your
wp-content
andwp-includes
folders. - Check the permissions of your CSS and JS files.
- Set the permissions to 644 for files and 755 for folders.
6. Use A Plugin To Fix The Issue
Some plugins can help you fix this issue. One such plugin is Yoast SEO.
- Install and activate Yoast SEO.
- Go to SEO > Tools.
- Click on File Editor.
- Make sure your
robots.txt
file allows Googlebot to access your CSS and JS files. - Save changes.
Frequently Asked Questions
What Causes Googlebot To Miss Css And Js Files?
The issue is often due to incorrect file permissions or blocked resources in the robots. txt file.
How Do I Check If Googlebot Can Access My Files?
Use Google Search Console’s “Fetch as Google” tool to see if Googlebot can access your files.
Why Is It Important For Googlebot To Access Css And Js Files?
Googlebot needs these files to render your pages correctly and understand your site’s layout.
How Can I Fix Robots.txt Blocking Css And Js Files?
Edit your robots. txt file to allow Googlebot to access the necessary directories and files.
Conclusion
Fixing the “Googlebot Cannot Access CSS and JS Files” error is important. It ensures Google can see and understand your website. Follow these steps to fix the error and improve your site’s ranking.