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

    (@alexcozmoslabs)

    Hi,

    WordPress itself adds the trailing slash at the end of the URL, so our plugin just try to keep this as it is. If you have a special configuration, like you mentioned, you can try the following code to remove the trailing slash for the translated versions.

    /* Remove ending slash from url's and home_url for users who want this.*/
    add_filter( 'trp_get_url_for_language', 'trpc_remove_end_slash', 10, 6);
    function trpc_remove_end_slash($new_url, $url, $language, $abs_home, $lang_from_url_string, $lang_url_slug){
    return untrailingslashit($new_url);
    }

    /* Remove ending slash from url's and home_url for users who want this.*/
    add_filter( 'trp_get_url_for_language', 'trpc_remove_end_slash', 10, 6);
    function trpc_remove_end_slash($new_url, $url, $language, $abs_home, $lang_from_url_string, $lang_url_slug){
    return untrailingslashit($new_url);
    }
    • Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality
Viewing 1 replies (of 1 total)
  • The topic ‘TranslatePress adds a slash(/) at the end of the language slug by force’ is closed to new replies.