# ===================================================================== # robots.txt — WordPress (crawl management + hygiene; NOT a security wall) # ===================================================================== # IMPORTANT: # - robots.txt only gives crawl instructions to compliant bots. It does NOT protect sensitive data. # - Protect sensitive endpoints/files with server rules (nginx/Apache), WAF/CDN rules, auth, and # correct filesystem permissions. # - Avoid blocking CSS/JS/images needed for rendering, or you can harm SEO. # # Replace the Sitemap URL(s) at the bottom with the sitemap(s) your site actually serves. # Common WordPress sitemap locations: # - WordPress core: /wp-sitemap.xml # - Yoast / Rank Math etc.: /sitemap_index.xml # ===================================================================== # --------------------------------------------------------------------- # 1) General directives (keep indexing focused on real public content) # --------------------------------------------------------------------- User-agent: * # Default posture: allow crawling, then block only non-public / low-value areas below. # ---- Crawl budget / duplicate-URL hygiene ---- # Internal WordPress search results are thin/duplicative and can create near-infinite URL combinations. Disallow: /?s= Disallow: /*?s= Disallow: /search/ # replytocom parameters create many duplicate URLs for the same post (comment permalinks). Disallow: /*?replytocom= # Author-ID query URLs are commonly used for user enumeration; they’re not useful for indexing. # (Public author archives like /author/username/ remain crawlable.) Disallow: /?author= Disallow: /*?author= # Common tracking parameters (optional; reduces duplicate URLs in the index). # Remove these lines if you intentionally want campaign-parameter URLs crawled/indexed. Disallow: /*?utm_* Disallow: /*&utm_* Disallow: /*?fbclid= Disallow: /*&fbclid= Disallow: /*?gclid= Disallow: /*&gclid= # --------------------------------------------------------------------- # 2) WordPress-specific protections (admin + core endpoints) # --------------------------------------------------------------------- # The admin area is not public content and should never appear in search results. Disallow: /wp-admin/ # Many themes/plugins use admin-ajax.php on the public site (forms, infinite scroll, etc.). # This "Allow" is an intentional exception so compliant bots can render pages correctly. Allow: /wp-admin/admin-ajax.php # The login page provides no SEO value and should not be indexed. # NOTE: This does NOT secure wp-login.php. If you need real protection, use server/WAF rules. # If you run a monitoring system that *must* hit wp-login.php, create a dedicated User-agent group # for that monitor and Allow it there. Disallow: /wp-login.php # XML-RPC is commonly probed/abused and rarely needed on modern sites. # Disallowing prevents indexing (but does not block access). Disallow: /xmlrpc.php # WordPress REST API endpoints are typically not intended for indexing (can create duplicate/utility URLs). Disallow: /wp-json/ Disallow: /*?rest_route= # Core endpoints that have no indexing value. Disallow: /wp-cron.php Disallow: /wp-comments-post.php Disallow: /wp-trackback.php # WordPress version/info files (reduce information disclosure in search results). Disallow: /readme.html Disallow: /license.txt # --------------------------------------------------------------------- # 3) Security restrictions (sensitive files, backups, cache/temp/logs) # --------------------------------------------------------------------- # Configuration / environment / VCS artifacts (must also be blocked server-side). Disallow: /wp-config.php Disallow: /wp-config-sample.php Disallow: /.env Disallow: /.env.* Disallow: /.git/ Disallow: /.svn/ Disallow: /.hg/ Disallow: /.DS_Store # Cache and temporary folders (low-value; can expose internal paths or stale content). Disallow: /wp-content/cache/ Disallow: /cache/ Disallow: /tmp/ Disallow: /temp/ Disallow: /cgi-bin/ # Logs and debug output should not be indexed (and should be protected server-side). Disallow: /wp-content/debug.log Disallow: /wp-content/wflogs/ Disallow: /wp-content/uploads/wflogs/ # Common backup directories created by popular WordPress tools (adjust/remove if not used). Disallow: /wp-content/updraft/ Disallow: /wp-content/ai1wm-backups/ Disallow: /wp-content/uploads/ai1wm-backups/ Disallow: /wp-content/backup/ Disallow: /wp-content/backups/ Disallow: /wp-content/uploads/backup/ Disallow: /wp-content/uploads/backups/ # Common backup/dump/archive file types (often left by mistake). # If your site intentionally publishes downloadable .zip/.tar/etc files for SEO, remove those lines. Disallow: /*.sql$ Disallow: /*.sqlite$ Disallow: /*.bak$ Disallow: /*.backup$ Disallow: /*.old$ Disallow: /*.orig$ Disallow: /*.zip$ Disallow: /*.tar$ Disallow: /*.tar.gz$ Disallow: /*.tgz$ Disallow: /*.7z$ Disallow: /*.rar$ # Prevent indexing of PHP files in asset-heavy directories. # This reduces exposure of internal file paths without blocking CSS/JS/images needed for rendering. # (Wildcard patterns like * and end anchors $ are widely supported by major search engines.) Disallow: /wp-includes/*.php$ Disallow: /wp-content/plugins/*.php$ Disallow: /wp-content/themes/*.php$ Disallow: /wp-content/uploads/*.php$ # Reduce version disclosure from common plugin/theme readme/changelog/license files. Disallow: /wp-content/plugins/*/readme.* Disallow: /wp-content/plugins/*/changelog.* Disallow: /wp-content/plugins/*/license.* Disallow: /wp-content/themes/*/readme.* Disallow: /wp-content/themes/*/changelog.* Disallow: /wp-content/themes/*/license.*