• Resolved vikashraghav096

    (@vikashraghav096)


    Dear WP Optimize Support Team,

    I am experiencing an issue after installing and activating the WP Optimize plugin on my WordPress website. I have noticed that extra code is being added to my robots.txt file automatically. Specifically, the following rule appears:

    User-agent: * Disallow: /wp-content/uploads/wpo/wpo-plugins-tables-list.json

    This addition is unexpected and is not coming from any physical robots.txt file or other plugins. I require full control over my robots.txt file and would prefer not to have any unwanted rules injected automatically.

    Could you please assist me in resolving this issue or provide guidance on how to disable this behavior?

    Thank you for your support.

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

Viewing 1 replies (of 1 total)
  • Plugin Support Damilare

    (@deabiodun)

    Hi!

    That rule was added for security purposes, as it basically instructs search engine crawlers to avoid accessing or indexing the wpo-plugins-tables-list.json file.

    You can automatically prevent that entry by applying the following code:
    function remove_wpo_plugins_tables_list_json($output) {
    // Define the line to remove
    $upload_dir = wp_upload_dir();
    $path = wp_parse_url($upload_dir['baseurl']);
    $line_to_remove = "User-agent: *\nDisallow: " . str_replace($path['scheme'].'://'.$path['host'], '', $upload_dir['baseurl']) . "/wpo/wpo-plugins-tables-list.json";

    // Remove the specific line from the output
    $output = str_replace("\n" . $line_to_remove, '', $output); return $output;
    }
    add_filter('robots_txt', 'remove_wpo_plugins_tables_list_json', 100, 1);

    Place the code in your theme’s functions .php file or preferably in a code snippet.
    Feel free to get in touch if you need further assistance.

    Regards,
    Damilare.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.