Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

This topic contains 13 replies, has 3 voices.

Last updated by Bigul 3 years, 11 months ago.

Assisted by: Bigul.

Author Posts
May 19, 2021 at 2:43 pm #8801479

markB-61

Hi there.
We spotted a weird issue, need some help.
We translated a site and after that Sitemap URLs(for attachments) stopped working.
The sitemap is generated via Yoast plugin.
If i turn off the WPML plugin, the URLs are visitable, but when turn back on, we're getting "Page not found" error.
Any suggestions?

Thanks.

Screenshot 2021-05-19 at 14.56.42.png
Screenshot 2021-05-19 at 15.16.59.png
Screenshot 2021-05-19 at 15.17.25.png
Screenshot 2021-05-19 at 15.41.08.png
May 19, 2021 at 3:54 pm #8802045

Itamar
WPML Supporter since 02/2016

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Please ensure that you are following our instructions at the following link on how to work with WPML and the Yoast SEO plugin?

https://wpml.org/documentation/related-projects/using-wordpress-seo-with-wpml/

It is important to know that we have a bridge plugin called WPML SEO that you must install when working with the Yoast plugin. I can see that it is not active on your site.

Regards,
Itamar.

May 20, 2021 at 8:12 am #8806005

markB-61

Hi.
Thank you for letting me know.
I installed the missing plugin,
but the issue still persists.

May 21, 2021 at 12:46 am #8812831

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. Please deactivate Redirection and Loco Translate plugins after a site backup. Then resave the permalinks from Settings>>Permalinks and make sure the bug is existing or not.

If the issue exists, please fill the private details fields after a full site backup. I would like to access the admin area of your site for further checking.

Please refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

May 21, 2021 at 5:06 pm #8821289

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback and login information. This may be a compatibility issue. So just to make sure, are you using a custom theme or is it a child theme?

Please upgrade to the latest version of plugins including Yoast after a full site backup{mandatory} and resave the Yoast & Permalinks settings. Then make sure is there any difference in the result.

--
Thanks!

Bigul

May 24, 2021 at 7:57 am #8830821

markB-61

Hi.
We are using a custom theme.
I updated all the plugins and resaved the permalinks, but didn't help.

May 24, 2021 at 3:11 pm #8834709

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. It requires further testing. So please allows me to make a duplicator copy of your site using the Duplicator plugin(https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server.

--
Thanks!

Bigul

May 24, 2021 at 4:04 pm #8835201

markB-61

Hi Bigul.
Yes, that's ok, you can make a local copy and try to fix there.

Thanks for the awesome support.

May 25, 2021 at 1:23 pm #8842579

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the permission. I made a copy of the site and working on it locally now, will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

May 27, 2021 at 9:26 am #8858557

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

I had detailed testing on my local copy and the issue is not reproducible with default themes like(2020 or 2021). So it looks like a compatibility issue with your custom theme. So may we will support limitations here because of the custom theme - https://wpml.org/purchase/support-policy/

I will consult about this with our second-tier team for an expert opinion and get back to you as early as possible. Please wait.

--
Thanks!

Bigul

May 28, 2021 at 4:51 pm #8869851

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

The bug is existing after the primary troubleshooting procedures. So I have escalated the ticket to our second-tier team for further debugging. We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

June 7, 2021 at 11:38 am #8932653

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

The issue is escalated to our developers for further debugging and fixing. But we have a workaround for the time being. Please try the following steps after a full site backup and make sure the issue is existing or not.

1) Open the functions.php file of your site
2) Add the following code to the bottom of the file and save the changes


add_action('pre_get_posts', function ($query){
		if ($query->is_main_query() && !is_admin() && $query->get('name') && $query->get('post_type')) {
			$attachment = get_page_by_path($query->get('name'), OBJECT, $query->get('post_type'));
			if (is_object($attachment) && $attachment->post_type === 'attachment' ) {
				$attachment_id = apply_filters( 'wpml_object_id', $attachment->ID, 'attachment' );
				unset($query->query_vars['name']);
				$query->is_attachment = true;
				$query->set('post_type', 'attachment');
				$query->set('attachment_id', $attachment_id);
				$query->set('p', $attachment_id);
			}
		}
		return $query;
	});

3) Visit Settings>>Permalinks, resave the settings

We will get back to you soon when we have an update from our developers on this. Please wait.

--
Thanks!

Bigul

June 7, 2021 at 1:47 pm #8933789

markB-61

Hi Bigul.

Big THANK YOU for you and for the Team as well!!!!
The workaround seems to work well, tested now.

Thanks for the awesome support and helping sorting out this problem.

Let me know when you find a long term solution.

Thanks.

June 9, 2021 at 6:26 am #8948003

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. Happy to know you are getting the expected results now. We will get back to you as soon as possible when we have any updates from our developers on this. Please wait.

--
Thanks!

Bigul