WordPress GuideSEO → Robots.txt

WordPress robots.txt — a complete beginner’s guide

If you want better SEO and tighter control over how search engines crawl your WordPress site, robots.txt is your first stop. Even though it’s just a small text file, it plays a big role in how search engines see (and ignore) parts of your site.

Let’s walk through what it does, how to edit it, and the best practices to follow—whether you’re running a blog, a business site, or something in between.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

What is robots.txt in WordPress?

The robots.txt file is a plain text file that gives search engine bots instructions on what parts of your site they’re allowed to crawl. These bots—like Googlebot—scan your website to add your pages to search engines.

In WordPress, you don’t automatically get a physical robots.txt file when you install the software. Instead, WordPress generates a virtual version of it behind the scenes. You can see it by visiting:

yourdomain.com/robots.txt

This virtual file lives in memory, not in your file system. That means you can view it, but you can’t directly edit it unless you create a physical version yourself or use a plugin that replaces it.

Why robots.txt matters for SEO and site performance

The robots.txt file is important because it tells bots where to go and (just as importantly) where not to go.

Here’s why that matters:

Default WordPress robots.txt file and its limitations

Out of the box, WordPress includes a virtual robots.txt file with very basic rules. A typical version looks like this:

Here’s what it means:

This setup is fine for basic sites, but it doesn’t give you control over things like plugin folders, media files, or SEO-specific settings. That’s why most site owners eventually choose to customize their own.

How to view and test your current robots.txt file

Before editing anything, it helps to see what you’re starting with.

How to create or edit a robots.txt file in WordPress

You can edit robots.txt using a plugin, through cPanel/File Manager, or with FTP. Let’s go over each method.

Option 1: Using an SEO plugin like Yoast or Rank Math

Plugins make editing robots.txt beginner-friendly and reduce the risk of file errors.

With Yoast SEO:

With Rank Math:

Plugins will automatically create a physical robots.txt file in your website’s root directory that overrides the virtual one.

Option 2: Manually via FTP or File Manager

If you’re comfortable with file access, you can create the file directly.

Make sure the file is readable by search engine bots (permission 644 is standard).

Option 3: Using cPanel File Manager

Best practices for WordPress robots.txt configuration

Follow these tips to make sure your robots.txt file helps, rather than hurts, your SEO.

How to submit your robots.txt file to Google

If you’ve made big changes to your robots.txt file, it’s a good idea to tell Google.

Troubleshooting common robots.txt issues

Watch out for these beginner mistakes:

Additional resources

Comprehensive guide to securing WordPress with ModSecurity

This guide provides a comprehensive overview of how to use ModSecurity to enhance the security of your WordPress site.

Optimizing Largest Contentful Paint (LCP) in WordPress →

Understand how Largest Contentful Paint (LCP) impacts your WordPress site’s performance and how to optimize it for better user experience and SEO.






Why security matters for WordPress enterprise hosting

Use the blog as your guide to attacks to watch out for, security best practices, and steps to improve the WordPress protection you already have.

Originally from Albuquerque, New Mexico, Leslie Bowman has hopped around the country since graduating from undergrad. She focused on English and Latin American History in college and eventually attended graduate school in New York City. There, she developed a passion for short, persuasive arguments. Bowman found a love of copywriting and is now a Senior Copywriter at Liquid Web.