Hello,
We apologize for the issue you are facing with editing your robots.txt file. There are several common reasons why you might not be able to edit it:
-
Presence of a Physical File: If there is a physical robots.txt file in the root folder of your website, Rank Math may not be able to edit it. You can remove this file via FTP or cPanel File Manager.

-
Other Plugin Creates Robots.txt: If another plugin is creating the robots.txt file, you will need to disable that plugin to allow Rank Math to manage it.
-
Permission Issue on the Web Server: If there are permission issues, you may need to contact your web host for assistance.
-
The robots.txt File is Not Writable: If you see a "robots.txt file is not writable" error, you can add the following code to allow Rank Math to edit it:
/**
* Allow editing the robots.txt & htaccess data.
*
* @param bool Can edit the robots & htacess data.
*/
add_filter( 'rank_math/can_edit_file', '__return_true' );
Additionally, check your wp-config.php
file for the DISALLOW_FILE_EDIT
constant and ensure it is set to false:
define ('DISALLOW_FILE_EDIT', false);
If you continue to experience issues, please reply to this ticket with your site URL, and a human agent from our support team will assist you further. Thank you for raising this concern!
Sources:
I Can’t Edit My Website’s Robots.txt » Rank Math
Common robots.txt Issues & How to Fix Them » Rank Math
This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.