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

Last updated by Raja Mohammed 1 month, 1 week ago.

Assigned support staff: Raja Mohammed.

Author Posts
September 5, 2019 at 4:35 am

thaddeusR

I don't know why, but the Spanish resources have a strange redirect pattern that wont let me post with previews on social media. see here: hidden link

example of custom post hidden link

Please let me know what is the issue. how we fix this.

September 5, 2019 at 5:46 am
September 6, 2019 at 4:42 am #4523301

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I think i have something to share with you, the probel seem to be with canonical tags added by Yoast SEO plugin the link rel="canonical" part in the head section remained there.
Please try the suggested filter from Yoast to disable the canonical link.
Add this code to the functions.php file of your theme.

add_filter( 'wpseo_canonical', '__return_false' );

Reference links.
hidden link
hidden link

Once the code is added try the FB debugger, Please let me know if this information is helping you solve the problem?

September 6, 2019 at 5:14 am #4523345

thaddeusR

not work 🙁

September 6, 2019 at 11:56 am #4525121

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked this further, it seems like the facebook meta tag og:url is missing in the post source. I am not sure why it is not added there but it helps facebook identify the unique post.

Please try adding og:URL to the posts not sure how it can be done or why it is not added to the page. I suppose that would fix your issue.

hidden link

September 6, 2019 at 1:11 pm #4525439

thaddeusR

Other pages haven't og:URL. But it work without it. if you check home page. there haven't og:URL. hidden link

September 9, 2019 at 2:56 am #4533077

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Since you are using language as a parameter which can be treated as duplicate content by Facebook as the URL with parameters are categorized as versioned page URL, Which leads to removing the parameter form the URL link while FB tries to scrap the content which leads to a redirect.

Facebooks suggest og: URL to correctly scrap the content, the URL you have shared is still redirected to hidden link when I checked in FB object debugger.

I hope, adding appropriate og:url tag would resolve your issue.

September 9, 2019 at 7:23 am #4534027

thaddeusR

we added og:url hidden link
still no luck

September 9, 2019 at 11:53 am #4536767

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That's strange, I'm running out of suggestion here, One thing I noticed is the URL redirects to non-secure HTTP request which I think should be the reason, Please check if you have any redirect rules for https in you htaccess file make sure the redirect includes the URL parameters as well.

Resave the permalinks and clear the site cache, let me know the results

September 9, 2019 at 3:07 pm #4538297

thaddeusR

it is completely secure. I don't know why happen this.

September 10, 2019 at 4:29 am #4541751

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

After some detailed analysis and a bit of research, The issue seems to be related to HTTPS redirect, Facebook is still fetching the HTTP content ignoring the URL parameters. This might be from cache or HTTPS is implemented without a proper 301 redirect from HTTP.

Here is a nice explanation from the social media and SEO specialist why it happens
https://wordpress.org/support/topic/keeping-facebook-shares-circular-redirect-path-after-enforce-http-open-graph/#post-9355543

Detailed explanation about the issue and how to fix them
hidden link

There is also the possibility that your server might redirect some requests, Check your server access log if there is a redirect specifically for requests from facebook. In such case request your hosting provider for assistance.
https://stackoverflow.com/a/28073947

I would recommend checking the server access logs first since it gives a lot of information and then move on to other suggestions.

September 10, 2019 at 6:41 am #4542257

thaddeusR

Thank you. When I curl this exact URL in the command line, I'm receiving a 200 response code and no redirect. Here is the exact output:

curl -IL hidden link
bash: fc: history specification out of range
HTTP/2 200
server: nginx
date: Tue, 10 Sep 2019 06:36:20 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
vary: Accept-Encoding
link: <hidden link;; rel="hidden link"
link: <hidden link;; rel=shortlink
x-tec-api-version: v1
x-tec-api-root: hidden link
x-tec-api-origin: hidden link
expires: Tue, 10 Sep 2019 06:36:17 GMT
x-ua-compatible: IE=edge
x-content-type-options: nosniff
x-cacheable: SHORT
vary: Accept-Encoding,Cookie
cache-control: max-age=600, must-revalidate
x-cache: MISS
x-pass-why:
x-cache-group: normal
accept-ranges: bytes

Also, I have a browser extension that allows me to view redirects (see screenshot hidden link ), and this is also receiving a 200

I can't understand why facebook getting this redirect issue.

September 10, 2019 at 12:01 pm #4545021

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Try the suggestion mentioned here hidden link

Seems like you might need to whitelist the facebook crawler, I'm not 100% sure whether that would help. As far as I know that this the last piece of information I have from my side since the issue is not reproduced with normal curl requests.

September 13, 2019 at 5:53 pm #4570317

thaddeusR

ok. that doesn't work too. 🙁

September 16, 2019 at 5:02 am #4576313

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm out of suggestions, this is something beyond my knowledge of support. Please try investigating on the lines in finding the reasons for the redirect from https:// to http:// which is the actually causing the issue. As far as i can understand WPML does not cause any redirect from https to HTTP. You are also using language param as URL form which is being removed by Facebook.

I am afraid the issue is beyond my support capability. I would recommend consulting with social media integration developers who can give the exact reason for the issue.

Let me know if there is something else I can help.

Kind regards
Raja