The primary site is not part of the blog-collection, right? There is just the WordPress-way via hook:
add_action( 'wp_head', function() {
echo '<link rel=”alternate” href=”http://example.com/” hreflang=”x-default” />', PHP_EOL;
} );
No, primary site is part of blog-collection.
This is the situation:
<link rel=”alternate” href=”http://example.com/fr” hreflang=”fr_FR” />
<link rel=”alternate” href=”http://example.com/en” hreflang=”en_US” />
<link rel=”alternate” href=”http://example.com/de” hreflang=”de_DE” />
<link rel=”alternate” href=”http://example.com/” hreflang=”it_IT” />
I want add:
<link rel=”alternate” href=”http://example.com/” hreflang=”x-default” />
right?
accuracy:
<link rel=”alternate” href=”http://example.com/de/goofy” hreflang=”de_DE” />
<link rel=”alternate” href=”http://example.com/goofy” hreflang=”it_IT” />
<link rel=”alternate” href=”http://example.com/goofy” hreflang=”x-default” />
There is – at least at the moment – no separate filter or option that could help to define the x-default. A workaround in your case is the mentioned wp_head-filter:
add_action( 'wp_head', function() {
echo '<link rel=”alternate” href=”http://example.com/goofy” hreflang=”x-default” />', PHP_EOL;
} );