• Resolved hirschferkel

    (@hirschferkel)


    Seems like WPO will crash robots.txt somehow. How to fix this?

    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    Sitemap: https://ixtract.de/sitemap_index.xml Disallow: /wp-content/uploads/wpo-plugins-tables-list.json
    User-agent: *
    Disallow: /wp-content/uploads/wpo-plugins-tables-list.json

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

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

    (@vupdraft)

    Can you excludes your robots.txt url from caching >> advanced settings >> URL’s to exclude from caching?

    Thread Starter hirschferkel

    (@hirschferkel)

    I have excluded it, now, but it is still the wrong robots.txt which is visible at: https://ixtract.de/robots.txt

    What can I do to stop WPO to mix it up?

    Plugin Support vupdraft

    (@vupdraft)

    To remove these lines you can use the following code (add it to your themes 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); } }

    Thread Starter hirschferkel

    (@hirschferkel)

    It does not work. See error message: ?Uncaught Error: Undefined constant "‘after_setup_theme’"

    Thread Starter hirschferkel

    (@hirschferkel)

    I had to replace all single quotes with PHP 8.3. now it works. But is this the way it should work, to hook WP-Optimize?

    Plugin Support vupdraft

    (@vupdraft)

    For most people the addition to the robots.txt file does not cause an issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WOP crashes robots.txt’ is closed to new replies.