Skip to content
Basic Robots.txt for Magento: Practical Example and Where to Edit It
E-commerce · 3 min read

Basic Robots.txt for Magento: Practical Example and Where to Edit It

One of the fundamental tools for technical SEO is the robots.txt file, which tells search engines what to index and what not to index on a site.

Magento lets you manage the `robots.txt file directly from the admin panel, without having to access the server via FTP or edit files on it.

Where do you edit it?

You can configure the file from:

Admin > Content > Configuration > [Select store view] > Edit > “Search Engine Optimization” tab > Robots.txt Custom Instructions

This setting is per store view, so you can manage a custom robots.txt for each store if needed.

Basic robots.txt example for Magento

User-agent: *
Disallow: /admin/
Disallow: /customer/
Disallow: /checkout/
Disallow: /cart/
Disallow: /catalogsearch/
Disallow: /wishlist/
Disallow: /sendfriend/
Disallow: /review/
Disallow: /search/
Disallow: /index.php/
Disallow: /customer/account/
Disallow: /customer/section/
Disallow: /customer/account/forgotpassword/
Disallow: /customer/account/login/referer/
Disallow: /catalog/product_compare/
Disallow: /catalog/product/view/
Disallow: /contact/
Disallow: /newsletter/
Disallow: /*?dir*
Disallow: /*?limit*
Disallow: /*?mode*
Disallow: /*?p=*
Disallow: /*?price*
Disallow: /*?q=*
Disallow: /*?SID=
Disallow: /*?___from_store=
Disallow: /cgi-bin/
Disallow: /*.php$
Disallow: /*.php/
Disallow: /pub/
Disallow: /var/
Disallow: /setup/
Disallow: /errors/
Disallow: /cron.php
Disallow: /composer.json
Disallow: /LICENSE.txt
Disallow: /LICENSE_AFL.txt
Disallow: /README.md
Disallow: /INSTALL.txt

# Blocca le risorse non essenziali
Disallow: /media/catalog/product/cache/
Disallow: /media/wysiwyg/
Disallow: /media/tmp/
Disallow: /media/customer/
Disallow: /media/downloadable/
Disallow: /media/email/
Disallow: /media/import/
Disallow: /media/sitemap/
Disallow: /media/custom_options/

# Blocca l'indicizzazione delle query interne
Disallow: /*?___from_store=
Disallow: /*?SID=
Disallow: /*?___store=
Disallow: /*?p=

# Impedisce l'indicizzazione dei file CSS e JS (se non necessario)
Disallow: /static/
Disallow: /generated/
Disallow: /lib/

# Consentire l'accesso a file CSS, JS e immagini per un migliore rendering su Google
Allow: /media/*.css
Allow: /media/*.js
Allow: /media/*.png
Allow: /media/*.jpg
Allow: /media/*.jpeg
Allow: /media/*.gif
Allow: /media/*.svg
Allow: /media/*.webp
Allow: /media/*.woff
Allow: /media/*.woff2
Allow: /media/*.ttf
Allow: /media/*.otf

One of the fundamental tools for technical SEO is the robots.txt file, which tells search engines what to index and what not to index on a site.

https://www.tuosito.com/robots.txt

You might also like