This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is using the directory for the default language, and the SEO Framework is incorrectly adding this default language directory to all sitemap links in robots.txt, resulting in invalid URLs.
Solution:
We recommend modifying the SEO Framework plugin code to correct the sitemap URLs:
1. Open the file located at
.../wp-content/plugins/autodescription/inc/classes/sitemap/registry.class.php
.
2. Locate line 173.
3. Replace the line with:
$path_info = static::get_sitemap_base_path_info();
with:
$path_info = static::get_sitemap_base_path_info();<br />// Workaround for compsupp-7598<br />if ( $_SERVER['REQUEST_URI'] == 'https://cdn.wpml.org/robots.txt' ) {<br /> $wpml_language_directory = apply_filters('wpml_get_setting', false, 'urls')['directory_for_default_language'];<br /> if ( $id != 'base' && $wpml_language_directory && $list['base']['robots'] ) {<br /> $path_info['path'] = '/';<br /> }<br />}
Please note this is a temporary workaround. We are awaiting a more comprehensive solution from the plugin author.
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/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 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 7 replies, has 2 voices.
Last updated by 8 months, 1 week ago.
Assisted by: Bruno Kos.