Skip Navigation

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

Problem:
The client needed a way to set their Spanish translated pages to 'noindex, nofollow' without unpublishing them.
Solution:
We recommended two approaches:
1. Using Yoast SEO to set 'noindex, nofollow' on a page-by-page basis:
- Edit the page in the main language.
- Switch to the secondary language using the admin top bar.
- In the Yoast SEO section, disable the options for indexing.
Yoast SEO settings screenshot
Note: This action will switch from the advanced translation editor to the WordPress editor for that translation.
2. Adding code to the theme's header file to apply 'noindex' globally to all pages in Spanish:

<?php if(ICL_LANGUAGE_CODE == 'es'): ?>
<meta name="robots" content="noindex">
<?php endif; ?>

The client should replace 'es' with the appropriate language code if needed.

If the provided solution does not apply or is outdated, or if further assistance is needed, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that the latest versions of themes and plugins are installed. If the issue persists, please open a new support ticket at WPML Support Forum.

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 1 reply, has 2 voices.

Last updated by Mateus Getulio 8 months, 2 weeks ago.

Assisted by: Mateus Getulio.

Author Posts
March 19, 2024 at 5:55 pm #15428219

kurtK-7

My site includes spanish translations and the process of converting the site has gone on hold. Is there an easy way to set my translated pages to be no index, no follow. I really do not want to unpublish the pages and setting the pages in /es/ seems like an easier solution.

March 19, 2024 at 9:13 pm #15428918

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I can see you're using the Yoast SEO.

It is possible to set the no index on a page-by-page basis:

- Edit the page that you want to apply it in the main language
- Switch to the secondary language in the admin top bar
- Locate the Yoast SEO section and turn off these options: hidden link

Please bear in mind that doing it would switch from the advanced translation editor to the WordPress editor when editing this translation.

Another option, and a more global one, is to edit your theme's header file and include the following code:

<?php if(ICL_LANGUAGE_CODE == 'es'): ?>
<meta name="robots" content="noindex">
<?php endif; ?>

You can replace the language code based on your needs.

Please give it a try and let us know the results.

Best,
Mateus