• Resolved Armands

    (@armandsdz)


    Hi!

    Is there any way to detect programmatically if a post has an actual translation in a specific language i.e. translated post with actually different content than original?

    The original issue I’m trying to solve is the blog posts which (mostly) are not actually translated. Some posts are translated. Therefore it’s creating duplicate content issue for SEO purposes.

    I saw some posts regarding this in support forum but couldn’t really tell if you have a different take on this – is this creating a SEO duplicate content issue if I have a lot of blog posts that are duplicated in as many URLs as there are languages defined?

    Making manual exclusions/inclusions of what to translate is not really an option as then content people would need to constantly go in there and adjust settings when they publish something new.

    Therefore, I’m thinking to adjust robots meta tag with “noindex” for those post URLs that are not actually translated so that those are not indexed.

    So, to summarize:

    1. Is there any way to detect programmatically if a post has an actual translation in a specific language?
    2. Do untranslated blog posts create duplicate content issue?
    3. Do you see my plan of adding “noindex” as something that could remedy this issue (if it’s an issue)?

    Thanks!

Viewing 1 replies (of 1 total)
  • Hello there,

    Thanks for reaching out to us!

    1.

    TP works on a string by string translation, so the whole post content is not translated and stored as one entity, rather it is split into pieces. There are no filters that are triggered when a post is translated. If you have automatic translation on, then the post is translated when then a page containing the post is accessed.

    You can retrieve translation of a post content using this custom code. It also translates it automatically if untranslated.

    $trp = TRP_Translate_Press::get_trp_instance();
    $trp_render = $trp->get_component( ‘translation_render’ );
    global $TRP_LANGUAGE;

    $content_post = get_post($post_id);
    $content = $content_post->post_content; //actual text, it can be post title etc.
    $TRP_LANGUAGE = ‘en_US’; // language code of translated language
    $translated_custom_content = $trp_render->translate_page( $custom_content );

    Original-translated string pairs stored inside TP tables are linked to a particular post ID in wp_trp_original_meta, using the post_parent_id meta key. The original_id column refers to the original_id of the trp_dictionary_lang1_lang2 tables.

    2.

    Regarding your concern about SEO and duplicate content, this can indeed be a valid concern if a lot of your blog posts are duplicated in as many URLs as there are languages defined. This could potentially impact your SEO ranking due to perceived duplicate content by search engines. However, TranslatePress adds ‘hreflang’ attributes to your pages, which notifies search engines about the different language versions of your page. This should mitigate the risk of SEO penalties for duplicating content across different languages.

    3.

    Finally, your idea of adding the ‘noindex’ robots meta tag to untranslated posts does sound like a logical approach to avoid these URLs being indexed by search engines. While TranslatePress does not have an automatic feature for this, you may be able to achieve this with custom coding or a SEO plugin that allows for this kind of customization.

    Best Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Detect if post is translated’ is closed to new replies.