Open shahmanish877 opened 1 year ago
This has been requested in #1039 but it's a wider topic related to #668 so it's still on hold.
The language_attributes, is meant for another usage so this won't be possible with that filter.
Any other way to remove it?
On Wed, Mar 29, 2023, 3:17 AM Herr Vigg @.***> wrote:
This has been requested in #1039 https://github.com/qtranslate/qtranslate-xt/pull/1039 but it's a wider topic related to #668 https://github.com/qtranslate/qtranslate-xt/issues/668 so it's still on hold.
The language_attributes https://developer.wordpress.org/reference/functions/language_attributes/, is meant for another usage so this won't be possible with that filter.
— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1302#issuecomment-1487621836, or unsubscribe https://github.com/notifications/unsubscribe-auth/APXSF33VFL7CNDQS5FWAJT3W6NKGLANCNFSM6AAAAAAWKIHGIA . You are receiving this because you authored the thread.Message ID: @.***>
The output happens in: https://github.com/qtranslate/qtranslate-xt/blob/4e32d61966d614fb16f1642e030a5305f3eb3b75/src/frontend.php#L58 So you can change that locally in your website repo as a workaround.
But why do you want to remove this? If your website supports these languages you should tell the SEO where to find the alternative languages.
It's for one of my clients so I have to add what they ask. They said it's temporary.
If you want a quick and easy fix, add simply a return;
here before the block that outputs the <link>
tags. You still need the function for the echo <style>
above.
https://github.com/qtranslate/qtranslate-xt/blob/4e32d61966d614fb16f1642e030a5305f3eb3b75/src/frontend.php#L42
I understand this is not ideal but I prefer to come up with a proper fix and not have a filter that changes.
How can we remove hreflang in head?
I tried
function remove_hreflang_tags() { remove_action( 'wp_head', 'language_attributes' ); } add_action( 'init', 'remove_hreflang_tags' );
but that didn't do anything.