File editor: edit robots.txt and .htaccess
Edit robots.txt and .htaccess in RankKit SEO → Tools, with saved versions, one-click restore and automatic roll-back if a change breaks the site.
On this page
The file editor lets you change two files without FTP or your host's file manager: robots.txt, which tells crawlers what they may fetch, and .htaccess, the Apache and LiteSpeed configuration file in your site's root folder.
Open RankKit SEO → Tools and find the File editor card. It has a tab for each file.
Who can use it
Only administrators can save files (on multisite, only super admins). Saving is switched off everywhere when your wp-config.php sets DISALLOW_FILE_EDIT, the same switch that hides WordPress's theme and plugin editors. In that case the files are shown read-only.
WordPress must be able to write files directly. If your server asks for FTP details to install plugins, the editor says so and you edit the file with your host's file manager instead.
Edit robots.txt
WordPress normally serves a virtual robots.txt: no file exists, and WordPress writes it on the fly. RankKit SEO adds your sitemap, the AI crawlers you block and your extra rules (see Edit robots.txt).
The robots.txt tab shows that generated file. You can:
- Save robots.txt: serve exactly what is in the box instead. Your version replaces the generated one entirely, including RankKit SEO's AI crawler blocks and the sitemap line, so keep them in if you want them.
- Reset to generated: go back to the file RankKit SEO generates. This button appears once you have saved your own version.
- View robots.txt: open the live file in a new tab.
When a real robots.txt file exists
If a robots.txt file sits in your site's root folder, web servers send that file and WordPress's virtual one is never used. The editor tells you, and then:
- Save robots.txt writes your changes into that real file. The previous content is kept as a backup.
- Move the file aside renames it to
robots.txt.speedrank-<date>.bak, so WordPress and RankKit SEO manage robots.txt again.
Tip For small additions you don't need a full custom file. Use Extra rules in Settings → Robots & AI crawlers, and RankKit SEO keeps adding your sitemap and AI crawler rules for you.
Edit .htaccess
The .htaccess tab shows the file from your site's root folder. It only matters on Apache and LiteSpeed servers. On Nginx and other servers that ignore .htaccess, the tab says so; use RankKit SEO's redirect manager or ask your host for server-level rules instead.
Important A single wrong line in .htaccess can make every page of your site return a server error. Change only what you understand, one rule at a time.
RankKit SEO protects you in three ways:
- The WordPress block must stay. If the file contains
# BEGIN WordPress…# END WordPress, a save without it is refused, because your permalinks would stop working. - Automatic roll-back. After every save, RankKit SEO loads your home page. If it answers with a server error (500 or higher), RankKit SEO writes the previous file back and shows: "With these changes the site answered with a server error, so RankKit SEO put the previous .htaccess back."
- Previous versions. The last five versions are listed under Previous versions with the date and who saved them. Click Restore to put one back (the same safety check runs).
Discard changes throws away edits you have not saved yet.
FAQ
Why don't my robots.txt changes show?
A page cache or CDN may still serve the old file: purge /robots.txt. If a real robots.txt file exists, make sure you edited it on the robots.txt tab (the editor says so at the top), not only the Extra rules setting.
My site is down after an .htaccess change. What now?
RankKit SEO puts the old file back when the home page answers with a server error right after the save. If the problem only shows on other pages, open Tools → File editor → .htaccess and Restore the previous version. If you cannot reach wp-admin at all, rename .htaccess with your host's file manager or FTP, then sign in and restore a saved version.
Is the file editor part of RankKit SEO Pro?
No, it is in the free plugin.
Was this page helpful?
Related guides
Edit robots.txt
Add your own robots.txt rules, allow or block 15 AI crawlers one by one, and see exactly what RankKit SEO writes into your site's virtual robots.txt.
Create and manage redirects
Send old URLs to new ones with 301, 302 and 307 redirects in RankKit SEO, with hit counts, search, automatic slug-change redirects and one-click undo.
Backups, export and import settings
Back up and restore RankKit SEO's settings, SEO fields, alt text and redirects, and export them to a JSON file to move RankKit SEO to another site.
Still need help?
Email us with your WordPress and RankKit SEO versions and what you tried. Pro customers get priority replies.