The robots.txt file tells search engine crawlers which parts of your site they are allowed to visit.
CrawlWP lets you edit the robots.txt file from CrawlWP > Settings instead of creating or uploading a physical file yourself. The free version includes this feature.
This guide explains how to edit WordPress robots.txt via CrawlWP, what happens when you save your own rules, and how to avoid common crawling problems.
Understand robots.txt before editing it
robots.txt is a text file normally available at https://your-site.com/robots.txt. WordPress generates its robots.txt response automatically rather than storing it as a normal file on your server.
The file controls crawling, not indexing. Blocking a URL in robots.txt does not guarantee that it will disappear from search results. To keep a page out of search results, use noindex instead. See Noindex, nofollow and other robots directives per post.
Edit your robots.txt file with CrawlWP
To edit your WordPress robots.txt file with the CrawlWP SEO plugin, follow the steps below.
- Go to CrawlWP > Settings.
- Make sure the Settings tab is selected, then click Robots.txt in the left-hand menu.
- Tick Enable robots.txt editing. This makes the robots.txt content box editable.
- Edit the rules in the box.
- Click Save Changes.

While Enable robots.txt editing is ticked, the contents of robots.txt content become the complete robots.txt response for your site. Check the result by opening https://your-site.com/robots.txt in your browser.
When Enable robots.txt editing is not ticked, the box is read-only and WordPress’s normal robots.txt is used, even if you have saved content in the box before. Saving the section with the box unticked does not change your robots.txt.
What the box starts with
The first time you open the editor, CrawlWP fills the box with the robots.txt WordPress currently generates, including any lines other plugins add. A typical starting point looks like this:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://your-site.com/wp-sitemap.xml
The starting content is always the version for a public site. It doesn’t include the Disallow: / rule WordPress uses while Discourage search engines from indexing this site is enabled, so you won’t accidentally save a rule that blocks every crawler.
Common robots.txt rules
Additional rules can target a folder, a particular crawler, or your sitemap:
| Goal | Rule to add |
|---|---|
| Prevent all crawlers from visiting a folder | Disallow: /private-folder/ under User-agent: * |
| Prevent one crawler from visiting the entire site | User-agent: ExampleBot followed by Disallow: / |
| Point crawlers to your sitemap | Sitemap: https://your-site.com/wp-sitemap.xml |
Be careful not to block your theme or plugins’ CSS and JavaScript files. Google needs access to these resources to render your pages correctly.
Also keep the Sitemap: line in your saved content when you need it. While editing is enabled, the saved content is the whole file, so CrawlWP does not add the sitemap line back for you. See Understanding CrawlWP sitemaps.
Encoded characters such as %20 and characters such as < are kept as you typed them.
Restore WordPress’s default robots.txt
There are three ways to go back to the robots.txt WordPress generates:
- Untick Enable robots.txt editing and click Save Changes. Your saved content is kept, so you can turn editing back on later.
- Remove all text from the robots.txt content box and click Save Changes.
- Click Reset to defaults at the bottom of the section and confirm. This clears the saved content and turns editing off.
Check for a physical robots.txt file
A real robots.txt file in the site’s root directory takes precedence over WordPress’s generated response. In that case, your web server serves the physical file, and WordPress doesn’t receive the request.
CrawlWP shows the message:
“A physical robots.txt file exists in your site root.”
The message also gives the location of the file. While that physical file exists, the settings on the Robots.txt screen do not control the file visitors receive.
Delete or rename the physical file through your hosting file manager or FTP if you want CrawlWP to handle robots.txt. Copy its existing contents into robots.txt content first if you need to preserve its rules.
Watch for the blocking-all-crawlers warning
If robots.txt contains Disallow: / for all crawlers, CrawlWP warns you with the notification “Your robots.txt file is blocking all search engine crawlers.” This prevents search engine crawlers from visiting any page in WordPress covered by that rule.
If you no longer want to block crawlers, edit the robots.txt content box and remove Disallow: /. When the rule comes from WordPress itself, turn off Discourage search engines from indexing this site under Settings > Reading.
Using CrawlWP on a multisite network
Each site on a multisite network has its own Robots.txt settings. However, search engines read robots.txt from the root of the domain. On a subdirectory network such as example.com/site2/, the main site’s robots.txt is the one that applies.
For more information, see Using CrawlWP on WordPress Multisite.
For developers: change the output with a filter
The crawlwp_robots_txt filter receives the saved content and whether the site is public, and runs before the content is output. Return an empty string to use WordPress’s normal robots.txt instead.
add_filter( 'crawlwp_robots_txt', function ( $content, $public ) {
return $content . "\nUser-agent: ExampleBot\nDisallow: /";
}, 10, 2 );
The filter only runs while Enable robots.txt editing is ticked.
Troubleshoot robots.txt changes
My changes do not appear at /robots.txt. Check that Enable robots.txt editing is ticked. Then check whether a physical robots.txt file exists in the site’s root directory. If it does, that file is being served instead. If there is no physical file, clear your page cache and CDN cache, as some hosts and CDNs cache robots.txt responses.
The box is read-only. Tick Enable robots.txt editing first.
The Sitemap line disappeared. Your saved content replaces the whole file. Add the Sitemap: line to the robots.txt content box.
A blocked page still appears in search results. robots.txt controls whether crawlers can visit a URL; it does not act as a noindex directive. If a page needs to stay out of search results, use noindex and avoid blocking the page in robots.txt so search engines can see the directive.
Review the live file after every change
Because a saved CrawlWP robots.txt replaces the content WordPress would otherwise generate, check the live file after making changes. Open https://your-site.com/robots.txt and confirm that important rules, admin exclusions, crawler directives, and the Sitemap: line are still present.
Small changes to robots.txt can affect how search engines crawl an entire site, so avoid saving experimental rules without checking the resulting file.