在空间WordPress的根目录下创建xmlmap.php文件,内容为下面内容
<?php
require('./wp-blog-header.php');
header("Content-type: text/xml");
header('HTTP/1.1 200 OK');
$posts_to_show = 1000;
$ltime = get_lastpostmodified(GMT);
$ltime = gmdate('Y-m-d\TH:i:s+00:00', strtotime($ltime));
echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<!-- generated-on="<?php echo get_lastpostdate('blog');?>"-->
<?php echo '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
?>
<url>
<loc><?php echo get_home_url(); ?></loc>
<lastmod><?php echo $ltime; ?></lastmod>
&