• Resolved s3lf

    (@s3lf)


    Hi,

    I discovered two bugs with the robots.txt in the free version.

    Is there a way to make a pull requests on GitHub or can somebody from the core team fix it?

    1) When the option “Use a subdirectory for the default language” in TranslatePress is set to “Yes”, https://page.et/robots.txt redirects to https://page.et/en/robots.txt/ -> this should be avoided. I think the robots.txt should ways be in the subfolder

    2) Translate press translateds the robots.txt, so

    https://page.et/am/robots.txt

    now contains

    ????? ???? * ?????? /wp-admin/ ????/wp-admin/admin-ajax.php ???? ???? https://page.et/wp-sitemap.xml

    No bot will be able to read this.

    Please exclude robots.txt from the translation.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter s3lf

    (@s3lf)

    This would help for the second problem:

    // fix robots.txt does not need to be translated
    add_filter( 'trp_stop_translating_page', 'trp_robots_txt_dont_translate', 10, 2 );
    function trp_robots_txt_dont_translate( $bool, $output ){
        if ( substr($_SERVER['REQUEST_URI'],-10) === 'robots.txt') {
            return true;
        }
        return $bool;
    }
    Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    Thank you for letting us know about your problem!

    From what I tested, the issue is not replicable.

    Can you tell me please what SEO plugin do you use for this?

    Kind Regards,

    Thread Starter s3lf

    (@s3lf)

    Thanks for your answer,

    It’s in stock WordPress, I do not use any SEO Plugin.

    What steps did you do to replicate? Which Plugin version?

    Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    I tried with the latest version of TranslatePress and everything seems to be ok.

    What version did you use for this test?

    Let me know!

    Kind Regards,

    Thread Starter s3lf

    (@s3lf)

    Hi,

    I am also on the latest version (2.1.3)
    Auto translation was on. I opened the /am/robots.txt and it was translated.

    Which steps did you use to test?

    Regards,

    Alex

    • This reply was modified 3 years ago by s3lf.
    Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    Please update to the latest version of TranslatePress and check again if the issue is still there.

    If it does, there might be a conflict somewhere and you can run a compatibility test on a staging environment:

    ??*Briefly* disable all other plugins and enable the default Twenty Twenty One theme. Please also disable all add-ons. If this fixes the problem, as it probably will, enable everything one by one, checking each time to see when the problem returns.

    Please let us know when you find the conflict so that we can take a look and see what we can do about it.

    Kind Regards,

    Same here. Actual Translatepress. Actual WordPress. Robots.txt will be translated when accessing urls like

    https://example.com/en/robots.txt
    https://example.com/fr/robots.txt

    Using Rank Math as SEO Plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bugs with robots.txt (get translated, redirects to language folder)’ is closed to new replies.