Skip to content

How to add link rel alternate in sitemap tag urlset ? #16

Open
@lutskboy

Description

@lutskboy

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://www.example.com/english/page.html</loc> <xhtml:link rel="alternate" hreflang="de" href="https://www.example.de/deutsch/page.html"/> <xhtml:link rel="alternate" hreflang="de-ch" href="https://www.example.de/schweiz-deutsch/page.html"/> <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/english/page.html"/> </url>

see https://developers.google.com/search/docs/specialty/international/localized-versions?hl=ru#sitemap

Activity

changed the title How to add link rel alternate in sitemap? How to add link rel alternate in sitemap tag urlset ? on Sep 5, 2023
melbahja

melbahja commented on Sep 6, 2023

@melbahja
Owner

Hey,

you can use alternate method, see this for example:

$map->loc('/blog/13')->freq('monthly')->priority('0.8')->alternate("/ar/blog/13", "ar")->alternate("/de/blog/13", "de");

lutskboy

lutskboy commented on Sep 14, 2023

@lutskboy
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @melbahja@lutskboy

      Issue actions

        How to add link rel alternate in sitemap tag urlset ? · Issue #16 · melbahja/seo