• Resolved playbasfa

    (@playbasfa)


    Hello, using your plugin I understood that as soon as I create a new language, for example italian, i just need to add /it in order to go into the related page.
    There is no way to don’t add a translation to a specific page?

    I have a woocommerce shop and I just realised that woocommerce create automatically a page /shop, so if my shop is https://this-is-my-shop.com , woocommerce create a page like https://this-is-my-shop.com/shop and since I’ve Italian as additional language, you create an italian version like this https://this-is-my-shop.com/it/shop

    This is just an example, but my question is, in cases like this, where I don’t want this page existing anymore (the english one) and so I don’t want the italian version existing neither, and I’m gonna delete the page or use a redirect, the italian version will be deleted or redirected automatically?

    Thank you,
    Fabrizio

    • This topic was modified 4 years, 10 months ago by playbasfa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there,

    1: You can use the following:

    https://translatepress.com/docs/developers/translate-only-certain-pages/

    But keep in mind that it is an experimental addon right now so you`ll have limited functionality. (you cannot translate your homepage path. example https://www.exemple.com)

    Or you can make an empty plugin like this: https://gist.github.com/sareiodata/76f701e01db6685829db
    Add the following code to the end of it:

    add_action( ‘plugins_loaded’, ‘trpc_exclude_tp_from_pages’, -1 );
    function trpc_exclude_tp_from_pages(){
    $do_not_translate_path = array(‘contact’);
    $do_not_translate_path = array(‘home’);
    $do_not_translate_path = array(‘test-page-page’);

    foreach ( $do_not_translate_path as $path ){
    if ( !empty($path) && strpos($_SERVER[‘REQUEST_URI’], untrailingslashit($path)) !== false ){
    add_filter( ‘trp_allow_tp_to_run’, function(){return false; } );
    }
    }
    }

    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

    P.S. You can change the ‘contact’ with what you dont want to translate.

    2: If you delete a page that is translated in various languages you will delete the translated pages too. But you’ll need to make redirect for every single page for your desired location.

    Cheers,

    Thread Starter playbasfa

    (@playbasfa)

    Hello, thank you for your reply.
    About your answer number 2, can I ask you why I have to do these redirects?
    What happen if I don’t do it?

    Thank you,
    Fabrizio

    Thread Starter playbasfa

    (@playbasfa)

    Also, there is no way to see all the pages that are currently translated?

    Hello,

    The page that are being translated do not exist in “wordpress pages”. The pages are generated dynamically.

    In the future we have in mind to add a feature to see all the pages that are translated by translatepress.

    And to answer why you should do this redirects:

    To keep your seo generated traffic on your website you may want to make redirects for the translated page as well.
    Ex:

    You have a product page with a “candy” and for this product you have also a page translated in french that is “bonbons”.
    When you delete the product from your shop you delete the candy page and the “bonbons” aswell. in this case you may want to make sure you redirect the people who keep search for candy to homepage/en/ and the one who search for bonbons to homepage/fr/

    If you dont do it. the persons who will look for a candy on google and click on your website will get a 404error.

    Cheers,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translation of deleted and redirected pages’ is closed to new replies.