robots.txt It is an important file that directs search engines to crawl your website and control what content is allowed to be included. For WordPress users, this file can be easily managed using the Yoast SEO plugin. In this article, we will introduce the role of robots.txt, the basic rules, and how to use the Yoast SEO Make settings.
![Image [1]-Yoast SEO tutorial: how to view and modify the Robots.txt file](https://www.361sale.com/wp-content/uploads/2025/07/20250703111351532-image.png)
I. What is Robots.txt file?
Robots.txt is a plain text file located in the root directory of a web site that directs search engine spiders (such as the Googlebot(Bingbot) to crawl or skip specific content.
Example:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
The meaning of this code is: disable access to all search engines /wp-admin/ directory, but allow crawling AJAX Interface.
Second, why set Robots.txt?
A properly set up Robots.txt file can help:
- Stop meaningless or duplicate content from being indexed(e.g., back office, category pages, tabs)
- Protect sensitive pages from being indexed
- Direct search engines to focus crawling resources on high-value pages
For example.WooCommerce Stores often block /cart/,/checkout/ and other functional pages to avoid low quality content that can slow down SEO performance.
How to use Yoast SEO plugin to view Robots.txt file?
The Yoast SEO plugin for WordPress provides built-in Robots.txt file viewing and editing functionality without the need to manually access the hosting or FTP.
The steps are as follows:
- Login to WordPress Backend
- Go to the menu:Yoast SEO → Tools
![Image [2]-Yoast SEO tutorial: how to view and modify the Robots.txt file](https://www.361sale.com/wp-content/uploads/2025/07/20250703111722470-image.png)
- Click [File Editor] (File Editor)
![Image [3]-Yoast SEO tutorial: how to view and modify the Robots.txt file](https://www.361sale.com/wp-content/uploads/2025/07/20250703111736811-image.png)
- If your site allows editing, the current Robots.txt content will be displayed on the page
![Image [4]-Yoast SEO tutorial: how to view and modify the Robots.txt file](https://www.361sale.com/wp-content/uploads/2025/07/20250703111959654-image.png)
If the file doesn't exist yet, Yoast SEO provides a "one-click create" button that automatically generates the file in the root directory of the website. robots.txtThe
How to modify the Robots.txt file?
In the [File Editor] page, you can directly edit the Robots.txt content, for example:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /tag/
Disallow: /author/
Sitemap: https://yourdomain.com/sitemap_index.xml
Once you have finished editing, click the [Save Changes] button to update the robots.txt file.
V. Common Robots.txt configuration examples
Standard configuration (fits most WordPress sites):
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /?s=
Disallow: /tag/
Disallow: /author/
Sitemap: https://yourdomain.com/sitemap_index.xml
Enhanced privacy configurations:
User-agent: *
Disallow: /wp-login.php
Disallow: /wp-register.php
Disallow: /checkout/
Disallow: /cart/
Note: Do not block the following content, otherwise it will affect the page display effect
Disallow: /wp-content/themes/
Disallow: /wp-content/plugins/
This will prevent search engines from loading CSS/JS, thus affecting the mobile usability score.
VI. Verify whether Robots.txt is effective
Once you have completed the setup, you can access it through your browser:
https://yourdomain.com/robots.txt
![Image [5]-Yoast SEO tutorial: how to view and modify the Robots.txt file](https://www.361sale.com/wp-content/uploads/2025/07/20250703113928701-image.png)
Make sure the content is consistent with what is in the Yoast editor. The following tools are also recommended for testing:
- Google Search Console → Check Web site tool
- Screaming Frog SEO Spider
- Ahrefs Site Audit Tool
VII. Summary and recommendations
The Robots.txt file may be small, but it plays a big role in your SEO strategy. With the Yoast SEO plugin, it's easy to manage this critical file without going into the server. It is recommended that you check and update Robots.txt regularly to ensure that your search engine crawling strategy is aligned with your website structure and marketing goals.
Recommended Practice:
- Block low quality, duplicate or private pages
- reservations Sitemap Addresses, favorable indexing
- Avoid blocking CSS/JS file loading
Link to this article:https://www.361sale.com/en/65082The article is copyrighted and must be reproduced with attribution.






















![Emoji[wozuimei]-Photonflux.com | Professional WordPress repair service, worldwide, rapid response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![Emoticon[baoquan] - Photon Wave Network | Professional WordPress Repair Services, Worldwide Coverage, Rapid Response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments