Support » Theme: GeneratePress » hreflang tags

  • Hello,

    I noticed couple a days ago that Google Search Console is giving me an error about missing hreflang tags. But when I inspect the source code of our website, I can notice that these codes are added in the page html.

    The thing seems to be that these parts of code are located too far down in the head section which means that Google cannot detect them. Is there an easy way to move them higher up and close to the beginning of the head section?

    I’m using Polylang as my translation plugin.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi there,

    you would need to check with Polylang – to my knowledge Polylang uses a filter to add them to the wp_head. They may have included some attributes for changing the filters priority.

    Thread Starter elpayaso

    (@elpayaso)

    Hello David,

    Thank you for the reply. I have tried contacting the Polylang support but haven’t received a reply. I think their support is basically down. Is there any way that you would be able to help me out?

    I took a look at the Polylang code – theres not much we can do about changing its position in the head as they use a filter function to add it there,

    I had a goolge search and found other users with the same issue, and Polylang linked to this Doc:

    https://polylang.pro/doc/google-reports-error-about-hreflang-attributes/

    Thread Starter elpayaso

    (@elpayaso)

    Thanks David. I have read that one earlier. So there is basically nothing that I can do even within the code to fix it? Basically changing to another plugin would be the only option to solve it?

    Looking at there code – no i cannot see anyway to fix it other then to disable it – which this support ticket provides the answer:

    https://wordpress.org/support/topic/how-do-i-remove-hreflang-from-head/

    And then hook in your own hreflang or use a plugin to do that.

    Thread Starter elpayaso

    (@elpayaso)

    So adding the hreflang codes just manually to the header will not solve the problem?

    Maybe … according to the first post – some users have experienced the same issue and its just a case of waiting for Google to catch up.

    If you want to try adding them manually then you would first want to disable them using the filter provided here

    Thread Starter elpayaso

    (@elpayaso)

    Thank you David. I have a meeting with a friend of mine who is a professional coder. We will try to fix this with him. I don’t think it’s up to Google to recrawl the site as these codes have been there for more than a year. I read on WPML support site that Google has changed something in their crawling and it cannot detect codes that are too far down in the page html.

    Oh wow – yes i don’t think it would take that long to recrawl the site !

    Let us know how you get on!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.