Stuck on my server root folder, robots.txt file not deleting

WordPress generate a dynamic robots.txt which does not physically exists. To remove/disable it you have two options:

Option 1: Remove do_robots action in your theme functions.php or plugin

remove_action('do_robots', 'do_robots');

The action do_robots is still available to be added again by other plugins.

Option 2: Create a real robots.txt file, put it the root folder of your site. This will stop WordPress (or plugins) auto generate its own.

Leave a Comment