• Resolved mover

    (@mover)


    WP-Optimize adds lines to robots.txt for some reason:
    User-agent: *
    Disallow: /wp-content/uploads/wpo-plugins-tables-list.json

    But such a rule already exists and you get duplicates!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support vupdraft

    (@vupdraft)

    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 1 year, 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

    Plugin Contributor Venkat Raj

    (@webulous)

    @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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘A duplicate line is added to robots.txt’ is closed to new replies.