My robots.txt files are not writable.

#653672
  • Resolved Anonymous
    Rank Math free

    Hello! robots.txt file is not writable. Please can you help me with that? I need help. [moved to sensitive data section]

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math. We are sorry for any inconvenience this must have caused you.

    To enable Rank Math to edit the file, add the below filter to your site. Once done, you will be able to edit your robots.txt file even if your wp-config.php file contains a constant preventing you from editing 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' );

    Optionally, include the DISALLOW_FILE_EDIT constant in your wp-config.php file and set it to false. If this constant is already added, ensure that it is set to false, as shown below.

    define ('DISALLOW_FILE_EDIT', false);

    You can refer to this guide on adding filters to your site. https://rankmath.com/kb/filters-hooks-api-developer/

    For more information on how to solve this issue, please refer to our guide here. https://rankmath.com/kb/cant-edit-robots-txt/#not-writeable

    Let us know how this goes.

    Thank you.

    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.

Viewing 1 replies (of 1 total)

The ticket ‘My robots.txt files are not writable.’ is closed to new replies.