Skip Navigation

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

Problem:
The client was experiencing issues with their sitemap displaying pages that do not exist, specifically URLs containing "/en/" which were remnants of an old language setup. The client had already tried resetting Yoast sitemap and indexables without success.

Solution:
We recommended the following steps:
1. Re-enable English as a language temporarily in WPML > Languages.
2. Manually delete all media, pages, custom posts, taxonomies, and menus associated with English using the WordPress User Interface and the language switcher.
3. Remove the English language again and run the cleanup dialog.
4. Check WPML > Settings > Post Type Translation to ensure that any post types that should not be translatable are set correctly.
5. If necessary, temporarily set certain post types (like ACF Field Groups) to 'Translatable' to delete specific entries, then revert them to 'Not translatable'.
6. Run a MySQL query to clean up leftover entries in the database:

DELETE FROM `wp_icl_translations` WHERE `language_code` = 'en'

If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your case, we highly recommend checking 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 persists, please open a new support ticket.

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 10 replies, has 2 voices.

Last updated by Andreas W. 9 months ago.

Assisted by: Andreas W..

Author Posts
May 3, 2024 at 6:06 pm #15592487

jordanP-2

I am trying to: Make sure my sitemap is up to date, but I see quite a few pages that don't exist. I reviewed WPML settings to make sure there isn't a language that I didn't account for as well as force resetting Yoast sitemap and indexables. Nothing seemed to get rid of the non-existent pages.

Link to a page where the issue can be seen: hidden link

I expected to see: No URLs that contain "/en/"; it should either be "/", "/en-us/", or "/en-apac/"

Instead, I got: 26 URLs that contain "/en/" pages that don't exist. Not sure where these are pulling from.

May 3, 2024 at 11:38 pm #15592968

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Did you maybe recently change the site URL structure of your website and the site was recently using a language directory for the site's default language?

https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

If so, please edit the affected original pages, and save them again.

If this will not solve the issue, I suggest you set up a staging site and try to test the site in a minimal setup.

1) Disable all additional plugins unrelated to Yoast, WPML, and its add-ons. Now test again.

2) If this didn't resolve the issue, please switch to a default theme like Twenty Twenty-One to see if the issue might be related to the theme.

3) If this still does not clarify what is causing the issue, start reactivating the plugins one by one or activate them in small groups. Do this to check when the problem is reoccurring to see which plugin is causing the problem.

Once we have been able to identify the cause, we can then attempt to replicate the problem and then escalate it internally. In this case, we will provide a test site with WPML.

If the issue persists while testing with a default theme and only Yoast and WPML plugins, we need access to your site for further investigation.

If you are having issues running those tests, please let us know and I will offer our assistance.

Best regards
Andreas

May 10, 2024 at 5:44 pm #15616051

jordanP-2

Hi,

I didn't change it recently, but I did adjust a language. I think when I first set up the site, I used /en/ before I realized we needed to differentiate by region. (Now we're using /en-emea/, /en-apac/, and /en-us/.)

I looked at the Languages settings panel and noticed this. I'm assuming these are the pages showing up in the sitemap. What's the best way for me to remove them from the database?

Thank you!

Screenshot 2024-05-10 at 10.42.37 AM.png
May 11, 2024 at 3:11 pm #15617083

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This dialog should allow you to remove the languages if you click the "x" buttom on the right end of the column.

In case this fails, I would suggest you enable English again as a language at WPML > Languages and then remove the contents manually from the backend using the WordPress User Interface.

Once the language is active you will be able to use the language filters on the backend or change the language inside the top admin bar to English.

May 13, 2024 at 5:34 pm #15622159

jordanP-2

Hi Andreas,

Ah, I missed that "x". Thank you.

I got stuck in a loop: hidden link

Does that mean I need to go with your secondary recommendation?

May 14, 2024 at 2:22 pm #15625992

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I would suggest you try to enable English as a language again and try to manually clean up some of the content, specifically custom post types, as they could be related to the issue.

Then try to run the dialog again.

If you would like me to take a look into the issue I can offer to enable a private reply form in which you can provide me with admin access for the site.

May 14, 2024 at 4:42 pm #15626527

jordanP-2

Hi Andreas,

How do I enable English again? I can't find the option on the Languages page.

I'm fine with giving you access as long as the work you're doing won't cause downtime or anything to look odd on the site. If you think it might, I can give you access to a dev site first.

Thank you!

May 14, 2024 at 4:57 pm #15626608

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

May 14, 2024 at 7:50 pm #15626939

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On WPML > Languages > Add / Remove languages I added English as a language.

Then I removed all media, pages, and custom posts incl. taxonomies and menus for English by using WordPress's user interface and controlling the language with the language switcher inside the top admin bar.

Then I removed the English language and ran the dialog again.

This dialog will take some time to run, as there are many custom fields that have to be removed from the wp_postmeta table of WordPress.

Anyhow, I can still see an issue, and it looks to me as if there are English entries on the database's posts table that were related to a different post type that is no longer set to "translatable" or does not exist.

See WPML > Settings > Post Type Translation.

For example, if I set "Maps" in WPML as translatable I can delete 4 further posts for maps. The dialog appears not to be able to delete those automatically if the post type is set to no translatable.

The same goes with ACF Field Groups, as there are 9 English Field Groups on the DB but the post type is set to "Not translatable" which in fact is the recommended setting, but to delete the English field groups, the setting needs to be temporarily switched to "Translatable".

Also, there are 2 English ACF Post Types.

Once you delete those English ACF groups and post types please set the settings for those post types again to "Not translatable".

Left are now 7 entries that seem related to post types that no longer exist on the website.

It would also be expected that the dialog can not complete the task if the related post type is no longer used on the site. Possibly here was a plugin in use that has been deleted. The only way to delete this would be by investigating the database.

Would you agree if I install a plugin to take a look into the database?

May 15, 2024 at 5:59 pm #15632018

jordanP-2

Hi Andreas,

I'm fine with you installing a plugin to edit the database.

I noticed that the changes you made created a critical error on the front-end: hidden link

It isn't a big deal because this is a dev site. I need to know how to clean up this language without creating a critical error, though.

Thank you for your help!

May 16, 2024 at 6:43 am #15633055

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Sorry for the delay in answering, as I was not feeling well today.

I have cleaned up the database now.

I ran the following MySQL Query for this purpose:

DELETE FROM `wp_icl_translations` WHERE `language_code` = 'en'
May 16, 2024 at 6:27 pm #15636688

jordanP-2

Hi Andreas,

Hope you're feeling better! This did exactly what I needed it to do. Thank you so much! And thank you for sharing the SQL command--I can use that on the live site too.