Google (XML) Sitemap Generator for WordPress (selanjutnya disebut Sitemap Generator saja) merupakan salah satu “you must install” plug-in WordPress. Plug-in ini secara otomatis membuatkan sitemap yang konon juga merupakan salah satu unsur Search Engine Optimization (SEO). Sayangnya, hingga tulisan ini dibuat, Sitemap Generator v3.1.2 release 26 Desember 2008 belum mendukung blog multilingual. Sitemap Generator belum bisa membuatkan URL isi blog yang bukan berbahasa default.

SulhanSetiawan.com ditulis dalam dua bahasa, Indonesia (default) dan Inggris (kode en). Multilingual dibuat dengan qTranslate dengan mode pre-path. Sitemapnya bisa dilihat di sini, screenshotnya seperti di bawah ini.

Sitemap SulhanSetiawan.com

Sitemap SulhanSetiawan.com

Lihat bahwa ada sisipan /en/ pada URL untuk isi blog yang berbahasa Inggris. Sitemap seperti yang dicontohkan belum didukung oleh Sitemap Generator v3.1.2. Oleh karenanya, dalam file sitemap-core.php pada class GoogleSitemapGenerator, ganti function AddUrl menjadi sebagai berikut:

function AddUrl($loc,$lastMod=0,$changeFreq="monthly",$priority=0.5){
    $page = new GoogleSitemapGeneratorPage($loc,$priority,
                 $changeFreq, $lastMod);
    global $q_config;
    foreach ($q_config['enabled_languages'] as $language) {
      $urleach=qtrans_convertURL($loc, $language,true);
      $page->SetUrl($urleach);
      $this->AddElement($page);
    }
}

Lihat saja hasilnya. Masuklah ke wp-admin, lanjut ke bagian plugin Sitemap Generator, lakukan rebuild sitemap. Sitemap baru Anda biasanya ada di http://BlogAnda/sitemap.xml.

Google (XML) Sitemap Generator for WordPress (next is called as Sitemap Generator only) is one of “you must install” WordPress plugin. This plugin automatically make a sitemap that is said is also one element of Search Engine Optimization (SEO). Unfortunately, until this writing, Sitemap Generator v3.1.2 release December 26, 2008 does not yet support multilingual blog. Sitemap Generator can not make the contents of the blog URL instead of the default language.

SulhanSetiawan.com is written in two languages, Indonesia (default) and English (en code). Multilingual made with qTranslate with pre-path mode. The Sitemap can be seen here, like the screenshot below.

Sitemap SulhanSetiawan.com

Sitemap of SulhanSetiawan.com

See that there are insertions /en/ on the URL to the content of the English-language blogs. Sitemap has not supported as exemplified by Sitemap Generator v3.1.2. Therefore, in the file sitemap-core.php on GoogleSitemapGenerator class, replace the function addurl to be as follows:

function AddUrl($loc,$lastMod=0,$changeFreq="monthly",$priority=0.5){
    $page = new GoogleSitemapGeneratorPage($loc,$priority,
                 $changeFreq, $lastMod);
    global $q_config;
    foreach ($q_config['enabled_languages'] as $language) {
      $urleach=qtrans_convertURL($loc, $language,true);
      $page->SetUrl($urleach);
      $this->AddElement($page);
    }
}

Just look at the results. Go to the wp-admin, go to the Sitemap Generator plugin, do the rebuild sitemap. Your new sitemap usually on http://yourblog/sitemap.xml.

Time limit is exhausted. Please reload the CAPTCHA.

Notify me of followup comments via e-mail. You can also subscribe without commenting.