Skip to content
This repository was archived by the owner on Apr 22, 2021. It is now read-only.
This repository was archived by the owner on Apr 22, 2021. It is now read-only.

How to disable hreflang tags output even for the original domain? #51

@straube

Description

@straube

You may notice that even if you don't set a language for any domain, you still get a default hreflang tag in your page head. To disable this behavior, you can remove the action that adds that tag. To do so, add the following code to your theme's functions.php file:

function remove_multipledomain_hreflang()
{
    if (!class_exists('MultipleDomain')) {
        return;
    }
    $multipleDomain = MultipleDomain::instance();
    remove_action('wp_head', array($multipleDomain, 'addHrefLangHeader'));	
}

add_action('init', 'remove_multipledomain_hreflang');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions