Background of the issue:
I am trying to publish a post titled XYZ on site.com/news/xyz using a custom URL rewrite rule that adds /news/ to all my posts. When I upload a document named xyz.jpg to the media library, WordPress creates an attachment page at site.com/xyz. I don't mind these attachment pages, but when WPML is active, visiting site.com/news/xyz redirects me to site.com/xyz. I noticed a 301 request with a header 'X-Redirect-By: WPML' as seen here: hidden link.
Symptoms:
When WPML is active, visiting my post URL site.com/news/xyz redirects to the attachment page site.com/xyz. The issue is identified by a 301 redirect with 'X-Redirect-By: WPML'.
Questions:
Why is WPML redirecting my post URL to the attachment page URL?
How can I disable this redirect behavior?
I checked further, and you forgot to mention posts are set as Not translatable. This seems to be a known bug and it is escalated to our developers but I think it is a low priority, and it will take some time before we have a permanent fix.
What I can suggest is to try the following:
1) Possible workaround:
go to: wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-404-guess.php
adjust the method: \WPML_404_Guess::order_by_type_and_language_snippet
Change from: