Free website & SEO check: see your score in under a minute  ·  Check my website →Premium Windows software for marketers: talk to us for access and pricing  ·  Explore the software →
Platform Guide Updated May 22, 2026  ·  9 min read

Robots.txt for WordPress & Shopify: The 2026 Perfect-Setup Guide

WordPress and Shopify power roughly half the web, and they handle robots.txt in completely opposite ways, which is exactly where people get stuck. On WordPress you're editing a file (or a plugin's version of one, and they fight). On Shopify there is no file to edit; you edit a Liquid template that generates it on every request, so a "normal" robots.txt upload silently does nothing. Get the platform's model right and the rest is copy-paste. Get it wrong and you'll swear your edits aren't saving. This guide covers both models and the exact rules for each.

Quick verdict: WordPress: edit via Yoast/Rank Math OR a physical file at the root, never both (they override each other). Shopify: there's no static file, edit the robots.txt.liquid theme template. Both should add AI-bot blocks if you're opting out of training, plus a Sitemap directive. Use our free generator with the platform preset for a copy-paste-ready file.

What WordPress's Default Robots.txt Actually Says

If your WordPress site has no physical robots.txt file, WordPress generates one virtually. The default looks like this:

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

That's it. It blocks the admin area but allows the AJAX endpoint (which needs to be accessible for many plugins). It does NOT include:

  • A sitemap reference
  • AI training bot blocks
  • Login or registration page blocks
  • XML-RPC or REST API blocks
  • Internal search or pagination blocks
  • Comment author URL blocks

For most production WordPress sites, this is insufficient. The improved version follows.

How to Install Custom Robots.txt on WordPress

Method 1: Yoast SEO (most common)

  1. Yoast SEO → Tools → File Editor
  2. If no robots.txt exists, click "Create robots.txt file"
  3. Paste the recommended content from the previous section
  4. Save changes
  5. Verify by visiting yoursite.com/robots.txt

Method 2: Rank Math

  1. Rank Math → General Settings → Edit robots.txt
  2. Paste content, save
  3. Rank Math will replace WordPress's virtual file

Method 3: Manual upload (FTP / file manager)

  1. Save the recommended content as robots.txt in a plain text editor (VS Code, Sublime, or Notepad++ — not Word)
  2. Connect to your WordPress install via FTP or your host's file manager
  3. Upload to the same level as wp-config.php (the WordPress root)
  4. Visit yoursite.com/robots.txt to verify — it should show your custom content, not the virtual default

The physical file takes precedence over the virtual one automatically — no additional configuration needed.

Method 4: Code snippet plugin (advanced)

For programmatic control, use a plugin like Code Snippets and add:

add_filter('robots_txt', function($output) {
  return "User-agent: GPTBot\nDisallow: /\n\n" . $output;
}, 10);

This prepends your custom rules to whatever WordPress generates dynamically. Useful if you want WordPress's defaults plus a few extras.

What Shopify's Default Robots.txt Includes

Shopify's auto-generated robots.txt is more comprehensive than WordPress's. It includes blocks for cart, checkout, accounts, search, policies, and Shopify-internal paths. The default also includes a sitemap reference automatically.

Sample Shopify default (paths vary slightly by store config):

User-agent: *
Disallow: /admin
Disallow: /cart
Disallow: /orders
Disallow: /checkouts/
Disallow: /carts
Disallow: /account
Disallow: /collections/*sort_by*
Disallow: /*/collections/*sort_by*
Disallow: /collections/*+*
Disallow: /collections/*%2B*
Disallow: /collections/*%2b*
Disallow: /blogs/*+*
Disallow: /blogs/*%2B*
Disallow: /blogs/*%2b*
Disallow: /*?q=
Disallow: /policies/
Disallow: /search
Disallow: /apple-app-site-association

Sitemap: https://yourstore.myshopify.com/sitemap.xml

This is solid for the basics — better than WordPress's default. What it lacks: AI bot blocks, custom collection or tag blocks, and any store-specific cleanup rules.

How to Install Custom Robots.txt on Shopify

  1. Admin → Online Store → Themes
  2. Click the ⋯ menu on your live theme → Edit code
  3. Templates folder → Add a new template
  4. Choose "robots" from the dropdown — Shopify creates a robots.txt.liquid file with the default content already populated
  5. Modify the file to add your custom rules (see the recommended template above)
  6. Save — Shopify regenerates robots.txt immediately
  7. Verify by visiting yourstore.com/robots.txt
Important: if you remove the default Liquid loop, you'll lose Shopify's built-in protections for /admin, /cart, /checkouts. Always keep the default loop and add your customizations after it, never as a replacement.

WordPress vs Shopify: Robots.txt Comparison

FeatureWordPressShopify
Default fileMinimal (only /wp-admin/)Comprehensive
Customization methodPlugin or FTP uploadrobots.txt.liquid template
Sitemap auto-includedNo (default)Yes
AI bot blocks includedNoNo
Easy to breakModerate (one bad upload can block site)Low (Liquid template usually fails safely)
Validation toolsSearch Console + plugin previewsSearch Console + Shopify admin preview
Best plugin/methodYoast SEO or Rank MathNative robots.txt.liquid
Shopify ships with a better default; WordPress requires more customization out of the box. Both benefit from explicit AI bot blocks and sitemap directives.

Other Platforms (Quick Reference)

PlatformWhere to edit robots.txt
WixSettings → SEO → Advanced → Robots.txt (Business/Premium plans)
SquarespaceLimited — can append via Settings → Advanced → Code Injection
WebflowProject Settings → SEO → Robots.txt
GhostEdit /content/files/robots.txt or use a custom routes.yaml
Vercel / Next.jsPlace robots.txt in /public/ folder
NetlifyPlace robots.txt in your build output folder
Hugo / Jekyll / staticPlace in /static/ or /assets/ folder; it gets copied to build output
Almost every modern platform supports custom robots.txt. Squarespace is the notable laggard in customization flexibility.

Verify Your Setup Works

  1. Visit yoursite.com/robots.txt in a private browser window. You should see your custom content.
  2. Open Google Search Console → Settings → Robots.txt. Click "Request a recrawl" to force Google to fetch the new version.
  3. Use URL Inspection on a few URLs to test:
    • An admin URL — should show "blocked"
    • A normal blog/product URL — should show "allowed"
    • An AI training crawler test — not testable in Search Console, but verify the syntax in your file
  4. Wait 2-3 days for crawlers to refresh their cached version.
  5. Monitor Coverage report in Search Console for the next 2 weeks. "Blocked by robots.txt" entries should match your intent.
From a platform migration

The robots.txt bug I see most when a client moves between platforms: they carry over the mental model along with the content. A team that ran WordPress for years migrates to Shopify, edits a robots.txt the way they always did, confirms the file "looks right," and three weeks later half their collection pages are missing from Google because their actual changes never took, Shopify rebuilt the file from its template and ignored their upload. The reverse happens too: Shopify-native teams move to WordPress and assume they need a theme template. My rule when auditing any site now is to identify the platform's robots.txt model first, before reading a single rule, because a perfectly written ruleset applied through the wrong mechanism is just a file nobody is serving. The rules matter less than knowing which door they go through.

Frequently Asked Questions

Three common causes: (1) WordPress's "Discourage search engines" setting is off and a caching plugin is intercepting requests — clear cache and re-check. (2) Your host has a rewrite rule blocking the URL — check .htaccess or nginx config. (3) A security plugin is blocking the request — temporarily disable it and re-test.

No. /wp-content/uploads/ is where images and media live, and you want Google to crawl them for Image Search. Allow this path explicitly. The default minimal robots.txt accidentally blocks images when people over-block /wp-content/ entirely.

The robots.txt.liquid template requires a small amount of Liquid syntax knowledge. Several Shopify apps (like SEO Manager and Smart SEO) provide GUI-based robots.txt editors that abstract away the Liquid template. For one-time edits, copy our recommended template and paste it directly.

No — /wp-includes/ contains WordPress core PHP files that browsers don't need to access publicly. Blocking it just prevents bots from crawling those system files. The site continues to function normally. Just make sure you don't block CSS/JS in /wp-includes/ — modern WordPress sometimes loads core assets from there.

Yes — once you create the robots.txt.liquid template, you can add any custom User-agent rules you want, including bot-specific blocks for CCBot, GPTBot, and others. Add them after the default Liquid loop so you preserve Shopify's built-in protections.

Leaving the "Discourage search engines" checkbox enabled in Settings → Reading after launch. This adds a noindex meta tag to every page AND modifies robots.txt to block everything. Sites launch, fail to rank, and the fix is one checkbox in WordPress settings.

Get the platform model right first

WordPress's default robots.txt is too minimal; Shopify's is solid but missing AI-bot blocks. The recommended setup for both adds training-bot opt-outs, a sitemap directive, and platform-specific path blocks. But the step that prevents the silent failure is identifying the platform's model before you write a single rule: WordPress serves a file (don't run a plugin editor and a physical file at once), Shopify generates one from a Liquid template (a static upload does nothing). Use our generator with the platform preset for a tested, copy-paste-ready file, then install it the way that platform actually reads.