SEO Glossary

robots.txt in WordPress (WordPress)

Since WordPress 5.7, the platform auto-generates a default robots.txt (virtual — not a real file on the server). The default allows Google to crawl the whole site and points to the sitemap. But for customization — like blocking specific sections — you'll need an SEO plugin like Rank Math or Yoast.

How to edit robots.txt in WordPress?

Easiest way: Rank Math plugin (Rank Math > General Settings > Edit robots.txt) or Yoast SEO (Tools > File Editor). If a physical robots.txt exists on the server, it overrides the virtual one — so make sure there's no conflict.

Why isn't my WordPress site showing on Google?

Two most common reasons: first — 'Discourage search engines from indexing this site' is enabled in Settings > Reading (WordPress adds noindex sitewide). Second — a Disallow: / line left in robots.txt from development. Check both before anything else.

Related terms

robots.txt XML Sitemap WordPress SEO Noindex Crawl Budget

These term pages are coming soon to the glossary.

FAQ

WordPress robots.txt questions

Does WordPress create a robots.txt automatically?

Yes — since version 5.7, WordPress auto-generates a default file (virtual). You can see it at domain.com/robots.txt even without a physical file.

Where do I edit the file?

Via an SEO plugin: Rank Math or Yoast SEO have a built-in editor. Or upload a physical robots.txt to your site's root folder.

What is the ideal robots.txt setup for WordPress?

Allow crawling sitewide, reference the sitemap, and block: /wp-admin/, internal search (/?s=), and thin tag/archive pages if you don't use them.