The robots.txt file tells search engines which parts of your site not to crawl. If your site has been upgraded over the years, yours may be older than your Joomla. These steps apply to Joomla 5 and Joomla 6.
Compare yours with Joomla's
Joomla ships a current copy called robots.txt.dist in the site's main folder, and updates that file for you. It never changes your own robots.txt, because you may have edited it. Open the two side by side.
What to look for
- Don't block what pages need. Google has to load your CSS, scripts and images to see a page as a visitor does. If you see lines for /images/, /media/ or /templates/, those come from an old copy. Take them out.
- Keep the system folders. The lines for folders such as /administrator/, /cache/ and /tmp/ can stay.
- Add your sitemap. A line such as Sitemap: https://www.example.com/sitemap.xml tells search engines where it is, if you have one.
Blocking isn't hiding
A page blocked in robots.txt can still appear in results if other sites link to it. To keep a page out of results, use a noindex setting on the page, and let search engines crawl it so they can see that setting.
Check the result
After you save, open the robots.txt report in Google Search Console to see the version Google has read.