WPML: hreflang is not implemented correctly - wordpress

I am using WPML for my multi-lingual wordpress site. I am having an issue getting the hreflang attribute to be implemented properly.
According to this article:
https://support.google.com/webmasters/answer/189077?hl=en
The hreflang tag must include not only the url of the translated page, but also the url of the current page. For example, when I am on https://example.com the href tags should be as follows:
<link rel="alternate" hreflang="en" href="https://example.com" />
<link rel="alternate" hreflang="de" href="https://example.com/de" />
This seems to be the correct implementation, however when using WPML v 2.9 only the translated hreflang tag is displayed. For instance when I am on https://example.com it only shows the following:
<link rel="alternate" hreflang="de" href="https://example.com/de" />
I have ticked both options in WPML > Languages > SEO Options:
x Display alternative languages in the HEAD section.
x Add links to the original content with rel="canonical" attributes.
Perhaps I have misunderstood and having a canonical tag like this:
<link rel="canonical" href="https://example.com/" />
will suffice as the current page's hreflang tag. Thanks for any input.

I'm using WPML v3.1.8.4 and it's working fine for me. Can you try upgrading to the newest version?

I guess this may be a conflict between WPML and another plugin - seems WordPress SEO. I saw it somewhere in WPML Support Forum

If you are using Yoast Wordpress SEO and WMPL, juste add the following in your functions.php
add_filter( 'wpseo_canonical', '__return_false' );

Related

Should I set a default canonical link sitewide or Is possible to set a custom canonical link automatically in Tumblr?

Unfortunately, there's no way (that I know of - I tried below) for me to set a canonical link per Tumblr post so I was thinking of setting the canonical link (sitewide on the Tumblr) to my WordPress homepage - good idea or bad?
I added a content source link to the post and tried adding this to my tumblr theme but none worked, the link would come out blank...
{block:PermalinkPage}
{block:Posts}
{block:ContentSource}
<link rel='canonical' href='{SourceURL}'>
{/block:ContentSource}
{/block:Posts}
{/block:PermalinkPage}
{block:PermalinkPage}
<link rel='canonical' href='{SourceURL}'>
{/block:PermalinkPage}
{block:PermalinkPage}
{block:ContentSource}
<link rel='canonical' href='{SourceURL}'>
{/block:ContentSource}
{/block:PermalinkPage}
All help is appreciated, thanks in advance.
This code should work, it will only render on permalink pages that have pagination. Your posts would need to have pagination for this to work though.
{block:PermalinkPagination}
<link rel="canonical" href="{Permalink}" />
{/block:PermalinkPagination}
If you don't have pagination in each post, this code would work.
{block:PermalinkPage}
<link rel="canonical" href="{Permalink}" />
{/block:PermalinkPage}
If you don't want it to be sitewide, this code should also work and will only render on post pages and not on others.
{block:PermalinkPage}{block:Date}
<link rel="canonical" href="{Permalink}" />
{/block:Date}{/block:PermalinkPage}

WooCommerce Remove WordPress Header lines

I am just about to launch an eCommerce site using WordPress and WooCommerce and trying to tidy up the source code and strip out all the WordPress header lines.
The site is pure eCommerce with a blog for users and search engines, I believe the functions below are for a pure blog website.
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="http://www.domain.co.uk/xmlrpc.php"/>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.domain.co.uk/xmlrpc.php?rsd"/>
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.domain.co.uk/wp-includes/wlwmanifest.xml"/>
Does anyone know what is required from the above for WordPress to function? And how we can remove these from WordPress, if we can?
Thanks Kindly.
J
You can safely remove all of these from your header.php file. They aren't required for the site to function.
More info: In HTML5, the "profile" attribute was dropped.
The others are purely optional.
For de-registering the bottom two, you'll need to add some new lines to your functions.php:
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
These functions, from the wp_head action hook, can be viewed in wp-includes/general-template.php, starting on line 2190.
From this file, rsd_link "display(s) the link to the Really Simple Discovery service endpoint."
The wlmanifest_link "display(s) the link to the Windows Live Writer manifest file." If you don't use Windows Live Writer, there's no need for this.

Wordpress SEO by Yoast doesn't display meta tags on paginated pages

I have a wordpress site that has SEO Meta tags populated by Yoast plugin.
This seems to work fine, except on any paginated page. On page2 or higher there is no
<meta name="description" > tag. Is there a simple setting I need to change? I can't find anything about it online at all.
You have to check if your Wordpress header.php has a line with:
<?php wp_head(); ?>
That allows Wordpress to inject code in the header. It has to be just before the closing head tag </head>. If not present just add it.

How to add an RSS feed link globally to every page?

First thought was to include the link tag in my theme. If a theme can be used: which content type do I have to use?
If a theme cannot be used: where do I put the link tag?
Used it before, sorry, didn't recall #facepalm
How to do it:
Place the code manually in the resource section of your Xpage/Custom control as you are not be able to compute the href value:
<xp:this.resources>
<xp:linkResource rel="alternate" type="application/rss+xml"
title="Oliver Busse - OSnippets"
href="/#{javascript:config.getConfig().getItemValueString('pathSnippets')}/rss.xsp">
</xp:linkResource>
</xp:this.resources>

How do you find what wordpress theme someone is using?

How do you find what theme someone is using, for example what theme does the official wordpress blog use?
Here are the links :
http://en.blog.wordpress.com
http://en.blog.wordpress.com/2006/08/17/forgotten-birthday/
The theme being used is called h4.
You can find this out by looking at where the style sheet is located. The style sheet code from this page is
<link rel="stylesheet" type="text/css" href="http://s2.wp.com/wp-content/themes/h4/style.css?m=1345845332g&5" media="screen" />
so you can see that the theme is stored in wp-content/themes/h4.
I would assume that h4 is a custom theme and wont be available publicly though.
Edit
This website is also useful for finding a wordpress theme as you just stick in the url and it pulls all the meta information (if there is any) from the CSS for you.
http://whatwpthemeisthat.com/

Resources