Skip to main content
added 622 characters in body
Source Link
L Martin
  • 4k
  • 11
  • 25

Because this is onlyonly for search engines and communicating where to find your site - you could move all of this code over to your Sitemap which has no size limit and you can generate programmatically for allsubmit it in the search engine of your wiki pageschoice's Webmaster interface.

Advantages:

  • Make it as big as you like, without bloating your HTML. There's no limit!
  • No need to worry about confusing header link structures.
  • You can crawl your own site more easily and still hide links from other crawlers by naming your sitemap something obscure.
  • Generate it programmatically for your entire site.
  • It's easy to have Webmaster scan it for errors (indexing and parsing).
  • One file solution for what will be many pages you have to index and tag.
  • A script can auto-update it as you add content.

Disadvantages:

  • Longer to set up if you're only doing a few pages.
  • You have to update it separately from the HTML, if you're not using a script.

Here is the official Google documentation: https://support.google.com/webmasters/answer/2620865?hl=en

Here is example XML, with the first three links in your post:

<url>
    <loc>http://server/en/wiki/some-page/</loc> <!--The Original Page-->
    <xhtml:link 
             rel="alternate"
             hreflang="da" <!--Alternate language code-->
             href="http://server/da/wiki/some-page/" <!--Link to alt page-->
             />
<xhtml:link 
             rel="alternate"
             hreflang="de"
             href="http://server/de/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="et"
             href="http://server/et/wiki/some-page/"
             />
</url>

Because this is only for search engines and communicating where to find your site - you could move all of this code over to your Sitemap which has no size limit and you can generate programmatically for all of your wiki pages.

Here is the official Google documentation: https://support.google.com/webmasters/answer/2620865?hl=en

Here is example XML, with the first three links in your post:

<url>
    <loc>http://server/en/wiki/some-page/</loc> <!--Original Page-->
    <xhtml:link 
             rel="alternate"
             hreflang="da"
             href="http://server/da/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="de"
             href="http://server/de/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="et"
             href="http://server/et/wiki/some-page/"
             />
</url>

Because this is only for search engines and communicating where to find your site - you could move all of this code over to your Sitemap and submit it in the search engine of your choice's Webmaster interface.

Advantages:

  • Make it as big as you like, without bloating your HTML. There's no limit!
  • No need to worry about confusing header link structures.
  • You can crawl your own site more easily and still hide links from other crawlers by naming your sitemap something obscure.
  • Generate it programmatically for your entire site.
  • It's easy to have Webmaster scan it for errors (indexing and parsing).
  • One file solution for what will be many pages you have to index and tag.
  • A script can auto-update it as you add content.

Disadvantages:

  • Longer to set up if you're only doing a few pages.
  • You have to update it separately from the HTML, if you're not using a script.

Here is the official Google documentation: https://support.google.com/webmasters/answer/2620865?hl=en

Here is example XML, with the first three links in your post:

<url>
    <loc>http://server/en/wiki/some-page/</loc> <!--The Original Page-->
    <xhtml:link 
             rel="alternate"
             hreflang="da" <!--Alternate language code-->
             href="http://server/da/wiki/some-page/" <!--Link to alt page-->
             />
<xhtml:link 
             rel="alternate"
             hreflang="de"
             href="http://server/de/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="et"
             href="http://server/et/wiki/some-page/"
             />
</url>
Source Link
L Martin
  • 4k
  • 11
  • 25

Because this is only for search engines and communicating where to find your site - you could move all of this code over to your Sitemap which has no size limit and you can generate programmatically for all of your wiki pages.

Here is the official Google documentation: https://support.google.com/webmasters/answer/2620865?hl=en

Here is example XML, with the first three links in your post:

<url>
    <loc>http://server/en/wiki/some-page/</loc> <!--Original Page-->
    <xhtml:link 
             rel="alternate"
             hreflang="da"
             href="http://server/da/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="de"
             href="http://server/de/wiki/some-page/"
             />
<xhtml:link 
             rel="alternate"
             hreflang="et"
             href="http://server/et/wiki/some-page/"
             />
</url>