Skip Navigation

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

Problem:
Draft pages are appearing in the Language Switcher, causing 404 errors in SEO reports.
Solution:
If you're experiencing draft pages showing up in the Language Switcher, we recommend the following steps:
1. Increase the WP memory limit to at least 128MB, as this is the minimum requirement for WPML. You can do this by adding the following code to your

wp-config.php

file:

/* WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '256M');

Place it just before:

/* That's all, stop editing! Happy blogging. */

If your hosting provider has set limits on these values, please contact them to make the necessary changes.

2. Update WPML and its add-ons to the latest version. First, create a full website backup, then navigate to Plugins > Add new > Commercial, check for updates, and update any outdated components.

3. Clear all caching, including local and server/CDN caching, especially if you have a caching plugin active.

After completing these steps, check if the issue with draft pages appearing in the Language Switcher persists.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem continues, please open a new support ticket with us.

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.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mihai Apetrei 1 year ago.

Assisted by: Mihai Apetrei.

Author Posts
April 16, 2024 at 5:36 pm #15527680

simonH-46

Tell us what you are trying to do?

We have several pages in "Draft" that are not ready to be published. Not the whole language, just some pages in that language. The Drafts are appearing in the Language Switcher, and causing 404s to be reported in our SEO reports. How do I remove Draft pages from appearing in the Language Switcher?

Is there a similar example that we can see?
For example, this page: hidden link - there is a German link in the Switcher, but that page is set to Draft mode (isn't ready to be published). How do we get it to stop showing up in the Switcher?
What is the link to your site?

April 16, 2024 at 10:18 pm #15528351

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

As far as I am aware, that shouldn't happen.

Please try the following:

1. The WP memory limit needs to be increased as the minimum requirement for WPML is 128Mb WP Memory Limit: https://wpml.org/home/minimum-requirements/

❌ Very important: please make a backup of your site (files & database) before following any of the upcoming steps ❌

Please add this to your wp-config.php file to increase WP memory:

/* WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Paste it just before:

/* That's all, stop editing! Happy blogging. */

These settings can be limited directly by your hosting provider, so, if that’s the case, I recommend you contact and ask them to modify them directly. If you can get even higher values It would be great.


After they are modified, you can verify them from WPML >> Support page, just to make sure that they are correct.

2. Update WPML and add-ons to the latest version: create a full website backup then go to Plugins > Add new > Commercial > check for updates > update what is outdated

3. Make sure that you clear all the caching (I see that you have a caching plugin active): remove any local caching or server/cdn caching

Now, see if the issue is still happening.

I will be waiting for an update from you.

Mihai Apetrei

April 17, 2024 at 2:36 pm #15533340

simonH-46

I'll let you know if it happens again. Thanks!