• Resolved Deon

    (@deon-b)


    Hello!

    I have an english blog and I am planning to translate only 10 articles on my blog into other languages. I will do the translations manually, and I will place these 10 articles on dedicated subdomains it. de. fr. and the like.

    I was wondering if I can use your plugin for my use case, as it’s not clear to me if your plugin only works if you have site wide settings and I translate the whole site and such.

    My plan is to see how things go for these 10 articles first before I do the whole site.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author DAEXT

    (@daext)

    Hello Deon,

    Yes, using this plugin in your case is appropriate.

    On your blog you have to add the hreflang data for the 10 translated articles using the Connections menu. Then you have to repeat the process in the subdomains to achieve hreflang link back compliance.

    Thread Starter Deon

    (@deon-b)

    Hi,
    Thank you.

    So I will just create connections on each subdomain, for each URL, including home page and such.

    Will this method basically add some code in my functions.php file? (so technically I could just add this to my PHP) and would be the same?

    function add_hreflang_tags() {
    if (is_page()) {
    global $post;

    // Define hreflang relationships for this domain
    $translations = array(
    'how-to-eat-peach' => array(
    'en' => 'https://website.com/how-to-eat-peach/',
    'it' => 'https://it.website.com/come-mangiare-la-pesca/',
    ),
    'another-article' => array(
    'en' => 'https://website.com/another-article/',
    'it' => 'https://it.website.com/un-altro-articolo/',
    ),
    );

    $current_url = get_permalink($post);

    // Loop through translations to find matches
    foreach ($translations as $key => $langs) {
    if (in_array($current_url, $langs)) {
    foreach ($langs as $lang => $url) {
    echo '<link rel="alternate" hreflang="' . $lang . '" href="' . $url . '" />' . "\n";
    }
    break;
    }
    }
    }
    }
    add_action('wp_head', 'add_hreflang_tags');

    https://prnt.sc/YtDVbtc87lSD

    Is this in the screenshot correct?

    Is there any way to double check all is set up correctly in the end?

    Plugin Author DAEXT

    (@daext)

    Hello Dean,

    1. Yes. Adding a script is an appropriate alternative.
    2. The image is not visible.
    3. Yes, you can check the hreflang tags with various tools. E.g. Popular SEO tools, the Hreflang Tag Checker Chrome extension, online hreflang checker, etc.
    Thread Starter Deon

    (@deon-b)

    Hi,

    Thanks, I don’t know why the image is not showing. Can you check this?

    View post on imgur.com

    Plugin Author DAEXT

    (@daext)

    Hello Dean,

    Scripts are for languages that have different scripts (like Chinese). English does not have alternative scripts.

    The locale is for configuring geographical targets. E.g. English for users in US or English for users in Canada.

    Note that for questions on different subjects I recommend to open new dedicated forum threads.

    Hope this helps.

    Thread Starter Deon

    (@deon-b)

    Hi, thanks,

    I think this is the same thread, same line of question for me.

    If you see in the image I attached, the first 3 fields, and the red things I wrote, is that the correct way of using this plugin?

    On German subdomain:

    URL to connect: Here URL from site where plugin is installed, example: de.website.com/house/
    URL 1: Here URL from main site in english, example: website.com/house/
    Language 1: Here language from main site in english, example: English.

    URL to connect: Here URL from site where plugin is installed, example: de.website.com/house/
    URL 2: Here URL from second site in french, example: fr.website.com/house/
    Language 2: Here language from main site in french, example: French.

    On English main domain:

    URL to connect: Here URL from site where plugin is installed, example: website.com/house/
    URL 1: Here URL from subdomain in german de.website.com/house/
    Language 1: German

    URL to connect: website.com/house/
    URL 2: fr.website.com/house/
    Language 2: French

    On French subdomain:

    URL to connect: fr.website.com/house/
    URL 1: website.com/house/
    Language 1: English

    URL to connect: fr.website.com/house/
    URL 2: de.website.com/house/
    Language 2: German

    Like this is correct?


    Plugin Author DAEXT

    (@daext)

    Hello Deon,

    The URL to Connect field is where you want to add the hreflang tags.

    The URL 1, URL 2, etc. are the reference to the alternate pages. These should be adde based on the Google guidelines: https://developers.google.com/search/docs/specialty/international/localized-versions

    A few implementation examples with Hreflang Manager:

    For a feedback I recommend sharing a public URL with hreflang implemented. So that the tags and related link back can be checked.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘question about category’ is closed to new replies.