[Resolved] URLs found using languages that are not setup/active
This thread is resolved. Here is a description of the problem and solution.
Problem:
Yoast SEO sitemap. In the sitemap, there are links to pages with languages that no longer exist on the site. In addition, there are links with added /./, which look like this.
your-domain.com/de/./some-category/
The links work and lead to the correct category, for example.
your-domain.com/de/some-category/
But we don't want to have them on the sitemap in this way.
Solution:
The user wrote:
We've found the issue, there were some legacy rows in the wp_terms table from when we were doing the initial testing of languages on the site, and once we deleted those rows it fixed the issue.
1. We've installed your WPML SEO plugin in order for WPML to work nicely with Yoast SEO as advised by one of your colleagues when we first launched the website some time ago. Without this plugin Yoast does not include the German pages in any of the XML sitemaps.
2. With that in mind, some things in that plugin isn't behaving correctly.
2a. The first thing is that it's adding URL like hidden link (not the full stop and extra / in the URL). Why is it doing this?
2b. The second is that for some reason it's this plugin that's adding in these strange URLs for languages that aren't even active on the website. For example:
hidden link hidden link hidden link
Like I said, these languages (i.e. nl, fr and nl-be) don't even exist in the WPML settings? They did at one point when we were testing the site but we deleted them as the client only opted to translate German.
Are you able to help shed some light on why it's behaving in this way?
I can see the new issue you present where links in the sitemap look like this. hidden link
But in practice, you get the correct page when you press the link. hidden link
Can you please confirm this?
To be honest, I don't know why it's behaving in this way. But I'm here to investigate the issue and help you solve them.
About 2a, I assume it is related to a known issue with regular expressions. You can read about this known issue here.
Yes, you’re right, the URLs do ultimately redirect to the correct page as per your example, it’s just the URL is incorrect.
As per your idea re: RegEx, we’re not using Yoast Pro so therefore aren’t using that feature.
Also, Yoast auto generates the site maps live, there is no option to regenerate. My gut is there is a bug somewhere or the plugin is seeing some legacy data in the DB which shouldn’t be there.
Hi, and thanks for your confirmation and further details.
You wrote: "Also, Yoast auto generates the site maps live, there is no option to regenerate."
To generate a new sitemap, please proceed with the following.
1. Go to Yoast SEO -> Settings.
2. Scroll down or search for the API's section.
3. There, see the XML sitemap section.
4. Disable this feature and press the Save Changes button. Please see the attached screenshot.
5. Go to hidden link. When this feature is enabled, you will get a 404 (page not found) for this URL. This is how you ensure that the feature is turned off.
6. Enable the XML sitemap.
7. Go to the site map where you saw the wrong URLs and check if it is still there.
Do you have a staging site where we can investigate this issue?
Investigating the issue may include the following process we avoid doing on a production site.
I suspect that there is a collision with the theme or another plugin that might cause this problem. If possible, get your site into a minimum environment. Minimum environment means switching to a default WordPress theme like TwentyTwenty-One and no plugins activated except WPML and Yoast SEO.
First, check if the problem persists when the theme is switched to TwentyTwenty-One. If it persists, then deactivate all plugins except the WPML, its add-ons, and Yoast SEO itself (without its extensions). Then please check if the problem persists. If it does not persist, start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***
We've found the issue, there were some legacy rows in the wp_terms table from when we were doing the initial testing of languages on the site and once we deleted those rows it fixed the issue. We're just rolling out the fix on the prod site now.