Sunday, June 15, 2025

The Importance of Authenticity:...

In the world of blogging, it's easy to get lost in a sea...

Get Your Blog Noticed:...

As a blogger, having a great blog is just the first step. To...

How to Use Influencer...

In today's digital age, having a successful blog requires more than just creating...

Google Search History Powers...

Introduction to Gemini Update Google has announced an exciting update to its Gemini personal...
HomeWordpressWordPress Robots.txt Essentials

WordPress Robots.txt Essentials

Introduction to Robots.txt

The humble robots.txt file often sits quietly in the background of a WordPress site, but the default is somewhat basic out of the box and doesn’t contribute towards any customized directives you may want to adopt. This post is only useful for WordPress installations on the root directory of a domain or subdomain only, e.g., domain.com or example.domain.com.

Where to Find the WordPress Robots.txt File

By default, WordPress generates a virtual robots.txt file. You can see it by visiting /robots.txt of your install, for example: https://yoursite.com/robots.txt. This default file exists only in memory and isn’t represented by a file on your server. If you want to use a custom robots.txt file, all you have to do is upload one to the root folder of the install. You can do this either by using an FTP application or a plugin, such as Yoast SEO, that includes a robots.txt editor that you can access within the WordPress admin area.

The Default WordPress Robots.txt

If you don’t manually create a robots.txt file, WordPress’ default output looks like this:

- Advertisement -
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

While this is safe, it’s not optimal. Let’s go further.

Including Your XML Sitemap(s)

Make sure that all XML sitemaps are explicitly listed, as this helps search engines discover all relevant URLs. For example:

Sitemap: https://example.com/sitemap_index.xml
Sitemap: https://example.com/sitemap2.xml

Things Not to Block

There are now dated suggestions to disallow some core WordPress directories like /wp-includes/, /wp-content/plugins/, or even /wp-content/uploads/. Don’t! Here’s why you shouldn’t block them:

  1. Google is smart enough to ignore irrelevant files. Blocking CSS and JavaScript can hurt renderability and cause indexing issues.
  2. You may unintentionally block valuable images/videos/other media, especially those loaded from /wp-content/uploads/, which contains all uploaded media that you definitely want crawled.

Managing Staging Sites

It’s advisable to ensure that staging sites are not crawled for both SEO and general security purposes. I always advise to disallow the entire site. You should still use the noindex meta tag, but to ensure another layer is covered, it’s still advisable to do both. If you navigate to Settings > Reading, you can tick the option “Discourage search engines from indexing this site,” which does the following in the robots.txt file (or you can add this in yourself).

User-agent: *
Disallow: /

Google may still index pages if it discovers links elsewhere (usually caused by calls to staging from production when migration isn’t perfect). Important: When you move to production, ensure you double-check this setting again to ensure that you revert any disallowing or noindexing.

Cleaning Up Non-Essential Core WordPress Paths

Not everything should be blocked, but many default paths add no SEO value, such as the below:

Disallow: /trackback/
Disallow: /comments/feed/
Disallow: */feed/
Disallow: */embed/
Disallow: /cgi-bin/
Disallow: /wp-login.php
Disallow: /wp-json/

Disallowing Specific Query Parameters

Sometimes, you’ll want to stop search engines from crawling URLs with known low-value query parameters, like tracking parameters, comment responses, or print versions. Here’s an example:

User-agent: *
Disallow: /*?replytocom=
Disallow: /*?print=

You can use Google Search Console’s URL Parameters tool to monitor parameter-driven indexing patterns and decide if additional disallows are worthy of adding.

Disallowing Low-Value Taxonomies and SERPs

If your WordPress site includes tag archives or internal search results pages that offer no added value, you can block them too:

User-agent: *
Disallow: /tag/
Disallow: /page/
Disallow: /?s=

As always, weigh this against your specific content strategy. If you use tag taxonomy pages as part of content you want indexed and crawled, then ignore this, but generally, they don’t add any benefits.

Monitoring Crawl Stats

Once your robots.txt is in place, monitor crawl stats via Google Search Console:

  • Look at Crawl Stats under Settings to see if bots are wasting resources.
  • Use the URL Inspection Tool to confirm whether a blocked URL is indexed or not.
  • Check Sitemaps and make sure they only reference pages you actually want crawled and indexed.
    In addition, some server management tools, such as Plesk, cPanel, and Cloudflare, can provide extremely detailed crawl statistics beyond Google.

Conclusion

While WordPress is a great CMS, it isn’t set up with the most ideal default robots.txt or set up with crawl optimization in mind. Just a few lines of code and less than 30 minutes of your time can save you thousands of unnecessary crawl requests to your site that aren’t worthy of being identified at all, as well as securing a potential scaling issue in the future. By following these steps and customizing your robots.txt file, you can improve your website’s crawlability and overall SEO performance.

- Advertisement -

Latest Articles

- Advertisement -

Continue reading

The Anatomy of Shareable Content: What Makes People Share, Like, and Love Your Posts

Creating content that people want to share, like, and love is a key goal for anyone who uses social media, whether it's for personal or professional reasons. But what makes content shareable? Is it the way it looks, the...

The Importance of Evergreen Content in Your Blog Content Strategy

Creating a successful blog requires a well-planned content strategy. One key element of this strategy is evergreen content. Evergreen content is material that remains relevant and valuable to readers over a long period of time. It doesn't become outdated...

The Blog Growth Hacker: How to Use Creative Strategies to Drive Traffic and Sales

Blog growth hacking is a creative approach to increasing traffic and sales on your blog. It involves using innovative strategies to attract and engage your target audience, setting you apart from the competition. As a blogger, understanding and implementing...

Using questions and statements that create curiosity, like From Zero to Hero and Get Ready for a Traffic Surge

Creating curiosity is an art that can be used to capture people's attention and draw them in. By using questions and statements that spark curiosity, you can make your content more engaging and interesting to read. In this article,...