Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lutskboy opened this issue Sep 5, 2023 · 2 comments
Open

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

lutskboy opened this issue Sep 5, 2023 · 2 comments

Comments

@lutskboy
Copy link

lutskboy commented Sep 5, 2023

<?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

@lutskboy lutskboy changed the title How to add link rel alternate in sitemap? How to add link rel alternate in sitemap tag urlset ? Sep 5, 2023
@melbahja
Copy link
Owner

melbahja commented Sep 6, 2023

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
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants