Skip to content

Instantly share code, notes, and snippets.

@erikhansen
Last active April 2, 2020 09:11
Show Gist options
  • Save erikhansen/d080a64757b31047401080440d00c80b to your computer and use it in GitHub Desktop.
Save erikhansen/d080a64757b31047401080440d00c80b to your computer and use it in GitHub Desktop.
Recommended Magento 2 robots.txt
# TODO: Update this with appropriate url
Sitemap: https://www.example.com/sitemap.xml
User-agent: *
# Paths (clean URLs)
Disallow: /index.php/
Disallow: /catalog/product_compare/
# Need to allow these urls paths to be indexed, since M2 commonly includes these links in sitemap.xml
# Disallow: /catalog/category/view/
# Disallow: /catalog/product/view/
Disallow: /catalogsearch/
Disallow: /control/
Disallow: /contacts/
Disallow: /customer/
Disallow: /customize/
Disallow: /newsletter/
Disallow: /sendfriend/
Disallow: /wishlist/
Disallow: /review/product/listAjax/id/
# Do not index pages that are sorted or filtered.
Disallow: /*?*product_list_mode=
Disallow: /*?*product_list_order=
Disallow: /*?*product_list_limit=
Disallow: /*?*product_list_dir=
# Do not index session ID
Disallow: /*.php$
Disallow: /*?SID=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment