Hello,
We apologize for the issue you are facing with editing your robots.txt file in Rank Math. Here are some common reasons why you might be unable to edit it and how to resolve them:
1. Presence of a Physical File
If there is a physical robots.txt
file in the root folder of your website, you will not be able to edit it through Rank Math. You can check this by accessing your website’s root folder via FTP or cPanel File Manager. If you find a physical robots.txt
file, you can remove it and then try editing the file through Rank Math again.

2. Other Plugin Creating Robots.txt
If another plugin is managing the robots.txt
file, you will need to disable that plugin to edit it with Rank Math.
3. Permission Issues on the Web Server
Sometimes, permission issues on your web server can prevent editing. In this case, we recommend contacting your web host for assistance.
4. The robots.txt File is Not Writable
If you see an error stating that the robots.txt
file is not writable, 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 following line:
define ('DISALLOW_FILE_EDIT', true);
If it exists, change it to:
define ('DISALLOW_FILE_EDIT', false);
If you continue to experience issues after trying these solutions, please reply to this ticket, and a human agent from the Rank Math 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