Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: This website uses WooCommerce and all products are translated to German. They will be synchronised with the German Amazon store. The German pages should not be visible on this website itself though. So I have configured WPML to hide this language. Problem is that these hidden pages are also hidden for the Rest API/Webhooks that are used to sync the content. Is there a way to make these pages available for the Rest API/Webhooks, but keep them hidden for website visitors* and search engines?

Solution: You can use Yoast SEO to set the option for google indexing independently on each product. If you want to be able to set the value for this through ATE, you need to set the _yoast_wpseo_meta-robots-noindex custom field to translate and make the changes presented here: https://wpml.org/forums/topic/hide-a-translation-do-not-allow-indexing-by-search-engines/#post-8198137

Relevant Documentation: https://wpml.org/documentation/related-projects/using-wordpress-seo-with-wpml/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 18 replies, has 2 voices.

Last updated by John-Pierre Cornelissen 8 months, 4 weeks ago.

Assigned support staff: Radu.

Author Posts
February 15, 2021 at 3:23 pm #8089331

John-Pierre Cornelissen

Hi,

This website uses WooCommerce and all products are translated to German. They will be synchronised with the German Amazon store.

The German pages should not be visible on this website itself though. So I have configured WPML to hide this language. Problem is that these hidden pages are also hidden for the Rest API/Webhooks that are used to sync the content.

Is there a way to make these pages available for the Rest API/Webhooks, but keep them hidden for website visitors* and search engines?

I use Yoast SEO and Yoast SEO Multilingual. It would be ideal if I could tell Yoast to exclude German from it's site maps and tell it that it should not be visible in Search Engines, but that options isn't there for individual languages.

* I already made sure there is no language switcher and the browser language redirect is disabled. Also, the German pages are in their own directories.

Thanks
JP

February 16, 2021 at 10:47 am #8095643

John-Pierre Cornelissen

Hi, I asked Yoast support. They told me to set the noindex tag for the translations.

Is there a way to do that? Preferably on the Yoast settings level.

noindex.jpg
February 17, 2021 at 9:34 am #8104567

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

I found this article from Yoast:
hidden link

If you want to use this Allow search engines... option for the translated product, you can edit the original product, change to the translated product using the top language switcher, and then set the option on the Yoast area. You can give this a try and tell me how it goes.

Thanks,
Radu

February 17, 2021 at 12:33 pm #8106757

John-Pierre Cornelissen

Hi, I know that option is there, but when you try to edit the translated page, wpml gives a big warning that you shouldn't edit translated pages that way. Also, it's not a option to do that for each and every product.

I am looking at a way to
- 'translate' the Yoast setting for German to noindex as in the screenshot I shared, or
- a way to indicate that that setting on the page level should be translatable so I can specify that when translating with the ATE.

I have searched for that in the WPML settings » Custom Fields Translation, but can't find it there. I also searched in string translation and can't find it there either. I have both done that before for another plugin, but can't find this for Yoast.

By the way, Yoast adviced this

Consider developing on the plugin to force Yoast to automatically remove URLs from the sitemap (or apply a noindex tag each time you do a translation). You may need to review our developer documentation here hidden link;

February 18, 2021 at 12:55 pm #8118425

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey John,

If you edit a product and press the Show system fields on the Multilingual Content Setup at the bottom side, you can see that there's this custom field: _yoast_wpseo_meta-robots-noindex. This is the one that you might be looking for.

You can unlock it by going to WPML → Settings → Custom Fields Translation area and searching for it here. Just simply press the lock, set it to Translate, then go back to product editing.

Now that you just update the product (so the new setting of the field can be scanned) and translate the product, you should be seeing the value of this custom field available for translation. Can you give this a try, please?

Thanks,
Radu

February 18, 2021 at 1:56 pm #8119177

John-Pierre Cornelissen

Thank you Radu, that's exactly what I was looking for. Couldn't find it before, that's because it is a system field.

Ok, next challenge.
I enabled the translate option for that custom field, but when I translate a product, it still isn't listed in the ATE

It does show these standard fields
- field-_yoast_wpseo_metadesc
- field-_yoast_wpseo_focuskw

But not the one I just enable for translation
_yoast_wpseo_meta-robots-noindex

JP

February 18, 2021 at 5:12 pm #8121515

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

Once you set that custom field to Translate, you will be able to see the value of it available for translation only if you're using the Classic Translation Editor.
You can see how the value is store on the screenshot I attached.

Thanks,
Radu

Screenshot 2021-02-18 at 19.06.20.png
February 18, 2021 at 7:15 pm #8122067

John-Pierre Cornelissen

Hi,

I need to use the advanced translation editor because of the machine translation feature. It's not visible in the ATE.

JP

February 22, 2021 at 7:29 am #8141893

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

I run a few more tests on this one but couldn't find a way to make this custom field be translatable through ATE. In this case, I had to ask my colleagues to have a look at this and see if there anything that I'm missing. I'll give you a message back once I get a reply from one of my colleagues (which shouldn't take long).

Thanks,
Radu

February 22, 2021 at 11:53 am #8144393

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

The numeric values are not available for translation in ATE. However, I escalated this to the 2nd tier support so my colleagues can check this out and see if they have a workaround for the change you're looking for.
I'll keep you posted about the progress we're making on this one.

Thanks,
Radu

February 22, 2021 at 11:58 am #8144445

John-Pierre Cornelissen

Ok, thanks you so far.

February 22, 2021 at 12:04 pm #8144471

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

Anytime 🙂

I'll keep you posted about this.

Thanks,
Radu

February 25, 2021 at 9:07 am #8170429

John-Pierre Cornelissen

Hello, any idea when there will be news on this?

Thanks
JP

March 1, 2021 at 2:24 pm #8198137

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hey JP,

The Advanced Translation Editor is not made to show the number values available for translation. Since Yoast is saving the values of the custom field as a number, you can't translate it.

The only change that my colleague was made to find is to edit the class-wpml-element-translation-package.php file from wp-content/plugins/wpml-translation-management/classes/translation-jobs, look for this line:

$is_translatable = (bool) apply_filters( 'wpml_tm_job_field_is_translatable', $is_translatable, $job_translate );

and simply add this after it:

if ($job_translate["field_type"] == "field-_yoast_wpseo_meta-robots-noindex-0") {
$is_translatable = true;
}

Now, if you go back to the original product, make sure that the _yoast_wpseo_meta-robots custom field is set to translate, and make a small change to the product (like adding one more point to the end of a sentence), just edit again the translation, and use the search field on the top left corner and search for 0, 1, or 2. These are the values that can be stored on the Yoast option for search engines. Just add the value 0 to it (which is the option "No" for the Yoast field).

Thanks,
Radu

March 1, 2021 at 2:42 pm #8198435

John-Pierre Cornelissen

Thank you for getting back to me.

Is it not possible to do this in the 'Custom XML configuration' as usual?
Or in functions.php of the childe theme?

Because changes it in the plugins folder will be overwritten after each update.

Thanks
JP