How to Create or Edit robots.txt on Your Web Host
- Mina SeyfollahiAuthor
- Last updated
- 2 minutesReading time
- 1,465Views
- Mina Seyfollahi
- Last updated:
- 2 min read
- 1,465 views
A robots.txt file tells cooperating crawlers which URLs they may fetch. It is useful when launching a site or controlling crawler access to duplicate routes. Its rules are public and they are not a security control. Protect private content with authentication or network restrictions.
First open the site’s existing /robots.txt. Your CMS, application, or CDN may generate it. Review the current rules before replacing them, especially if the site already receives search traffic.
Create or edit the file
In your file manager or SFTP client, find the document root of the correct hostname. Create a plain-text file named robots.txt, or edit the existing rules at their source. For a site that allows all cooperating crawlers and publishes a sitemap, a simple example is:
User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xmlReplace the sitemap URL and add restrictions only where you intend them. Rules apply to the host, protocol, and port that serve the file. A blocked URL can still appear in search results. To remove an eligible public page from the index, use the appropriate indexing rule and allow crawling so search engines can read it.
Verify the live response
Open https://example.com/robots.txt using your real hostname. Confirm it returns the intended plain text with HTTP 200 and that the sitemap URL works. Check any cache that could serve an old copy. Test important URLs against the rules before launch. Google’s robots.txt guide.


