Robot.txt update issue

#1105206
  • Hi, I’ve been trying to update my robot.txt for several times and after I hit save, it stays the same without considering the modifications I’ve made.

    How can I solve this problem?

    Thank you in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    We apologize for the issue you are facing with updating your robots.txt file. There are a few common reasons why you might not be able to save changes to your robots.txt file using Rank Math:

    1. 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 check this by accessing your site via FTP or cPanel File Manager and removing the physical file if it exists.

    2. Other Plugin Interference: If another plugin is managing the robots.txt file, it may prevent Rank Math from making changes. Try disabling any other SEO plugins that might be creating the robots.txt file.

    3. Permission Issues: Sometimes, permission settings on your web server can prevent edits. In this case, you may need to contact your web host for assistance.

    4. Editing Restrictions in wp-config.php: If your wp-config.php file has restrictions set, you can add the following filter to allow editing:

      add_filter( 'rank_math/can_edit_file', '__return_true' );

      Additionally, ensure that the DISALLOW_FILE_EDIT constant is set to false:

      define ('DISALLOW_FILE_EDIT', false);
    5. Security Plugins: If you have security plugins like Really Simple Security, they might disable built-in file editors. You can check their settings and disable the option that restricts file editing.

    For more detailed guidance, you can refer to our tutorial on editing robots.txt with Rank Math.

    If you continue to experience issues, please reply to this ticket with your site URL so we can assist you further. Thank you for raising this concern!

    Sources:
    I Can’t Edit My Website’s Robots.txt » Rank Math
    I Can’t Edit My Website’s Robots.txt » Rank Math
    I Can’t Edit My Website’s Robots.txt » Rank Math

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    Hello,

    If the issue persists after following the steps above, please check if your website has the ModSec (ModSecurity) feature enabled on your server, as it can block some Rank Math processes.

    Looking forward to helping you.

    This usually happens due to caching or permission issues. Clear your site/server cache, make sure you’re editing the correct robots.txt file, and confirm write permissions. If using a CMS or plugin, check if it overrides manual changes.

    Hello,

    @Pakeeza Safdar We appreciate you sharing the troubleshooting steps to fix the issue.

    If you have any other concerns, please don’t hesitate to contact us anytime so we can assist you further.

    Looking forward to helping you.

    Hi, thanks for the reply.

    Yes, the ModSec feature is actually on for my domain.

    I’ve tried everything, even cleaning the cache. But the only thing that worked was disabling the extension of WP Optimize.

    Hello,

    Thank you for the update.

    If WP-Optimize is interfering with the saving process of your robots.txt, we recommend keeping WP-Optimize disabled (or adjusting its settings) when updating robots.txt in Rank Math. Once the changes are saved, you can re-enable the plugin if needed.

    You may also contact the support folks from WP-Optimized to configure the plugin properly for you so you can save the robots.txt without disabling it.

    Let us know how that goes. Looking forward to helping you.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this ticket.