Can you add the following to your functions.php;
add_action(‘after_setup_theme’, ‘ab123_remove_robots_txt_entry’);
function ab123_remove_robots_txt_entry() {
if (function_exists(‘WP_Optimize’)) {
remove_filter(‘robots_txt’, array(WP_Optimize(), ‘robots_txt’), 99, 1);
}
}
-
This reply was modified 2 years, 6 months ago by
vupdraft.
Thread Starter
mover
(@mover)
Errors appeared:
Warning: Use of undefined constant ‘after_setup_theme’ – assumed ‘‘after_setup_theme’’ (this will throw an Error in a future version of PHP) in /home/mover33/domains/moversoft.ru/public_html/wp-content/themes/mantra/functions.php on line 28
Warning: Use of undefined constant ‘ab123_remove_robots_txt_entry’ – assumed ‘‘ab123_remove_robots_txt_entry’’ (this will throw an Error in a future version of PHP) in /home/mover33/domains/moversoft.ru/public_html/wp-content/themes/mantra/functions.php on line 28
@mover I believe you copy/pasted the code.
add_action('after_setup_theme', 'ab123_remove_robots_txt_entry');
It should be either single quote or double quote copy/pasting may result in angled quote or backticks
Thread Starter
mover
(@mover)
It helped! It would be great if this problem was solved automatically in future versions.