WPIntell

Source evidence

Switcher url with slug not id

Zanto WP Translation (For Multisites) · support · 2016-05-19T09:33:00+00:00

complaintsentiment
mediumseverity
0.8relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 35 rows with source links

14.3% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

30 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Kim Soler unresolved
Hi somebody found a solution for this issue? Zanto uses the url with post id ( http://mysite.org/ensite?p=12 ) instead of the url with the slug ( http://mysite.org/ensite/post-slug ). This happens in language switcher tags <a href="http://mysite.org/ensite?p=12" hreflang="en-US" rel="alternate">English</a> and in header tags: <link href="http://mysite.org/ensite?p=12" hreflang="en-US" rel="alternate"> . I think that due to this issue Google Search Console throw the error “No return tags”… kappa had this problem and explains it in this post https://wordpress.org/support/topic/language-switcher-dep?replies=2 https://wordpress.org/plugins/zanto/ Hi there! I have the same problem. This plugins seems to be deprecated… it’s so sad. I’m trying to fix the issue. Try something like this: function get_tranlated_url($url){ $current_sites = wp_get_sites(); $original_blog_id = get_current_blog_id(); $translated_url = ""; foreach($current_sites as $site): if($site['blog_id'] != $original_blog_id){ switch_to_blog( $site['blog_id'] ); $translated_url = get_permalink(url_to_postid($url)); } endforeach; // Switch back to the current blog switch_to_blog( $original_blog_id ); return $translated_url; }

Comments

2 shown
Carlos 2016-05-19T12:16:00+00:00

Hi there! I have the same problem. This plugins seems to be deprecated… it’s so sad. I’m trying to fix the issue.

Carlos 2016-05-19T12:45:00+00:00

Try something like this: function get_tranlated_url($url){ $current_sites = wp_get_sites(); $original_blog_id = get_current_blog_id(); $translated_url = ""; foreach($current_sites as $site): if($site['blog_id'] != $original_blog_id){ switch_to_blog( $site['blog_id'] ); $translated_url = get_permalink(url_to_postid($url)); } endforeach; // Switch back to the current blog switch_to_blog( $original_blog_id ); return $translated_url; }