Issue-167: Make it possible to add values to robots.txt via the admin#170
Open
anubisthejackle wants to merge 11 commits intomainfrom
Open
Issue-167: Make it possible to add values to robots.txt via the admin#170anubisthejackle wants to merge 11 commits intomainfrom
anubisthejackle wants to merge 11 commits intomainfrom
Conversation
kevinfodness
requested changes
Apr 1, 2026
Member
kevinfodness
left a comment
There was a problem hiding this comment.
I don't want this to be managed through network options. I want this to be a per-site setting. It needs to work on both single sites and multisite, and for multisite, we should be able to configure the settings on a per-site basis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #167
This pull request adds the ability for administrators to manage and customize the site's robots.txt output directly from the WordPress admin interface. The update introduces both site-level and network-level (for multisite installations) settings for robots.txt, allowing custom directives to be added without requiring file system access. The plugin leverages the
robots_txtfilter to append or prepend custom content, and all logic is encapsulated to ensure compatibility with other plugins and WordPress core.Context
Previously, modifying robots.txt required direct file access or code changes, which was not possible in certain hosting environments (e.g., VIP, Pantheon). This update empowers both site and network administrators to manage robots.txt rules through the admin UI, without interfering with existing
robots_txtfilter usage from the core or other plugins.Features
A new "Robots.txt" section is available in the SEO settings page for single sites and on the network settings page for multisite installations.
Admins can view a live preview of the compiled robots.txt output before saving changes.
Separate fields for adding custom directives at both the site and network level.
Network administrators can set global rules, which are combined with individual site rules for the final output.
Uses the
robots_txtfilter to dynamically update the robots.txt output based on saved settings.Includes code clean-up, consolidated meta box logic, improved maintainability, and updated hardcoded values for consistency.
Use Case
Admins can now quickly adjust robots.txt content from the WordPress dashboard, streamlining SEO management and compliance with search engine guidelines—no code or file uploads required.
Checklist